agustin_2 Posted January 14, 2015 Posted January 14, 2015 Hello there, We are currently using Visualize.JS to display charts and tabular data inside our application. At the moment, we are using plan basic authentication for testing purposes. Sometimes, after using it a while or leaving the computer on and coming back... we get this message in the console: [Error] Failed to load resource: the server responded with a status of 401 (Unauthorized) (reportExecutions, line 0)[Error] 11:28:16.38 [bi/component/Report] [ERROR] - authentication.error : Authentication error When this happens we do not get any output. Is there any way to detect this and authenticate "again"? Because when I try to do so it does not work. It looks like the only way possible to make it authenticate again is to clean the browser cache. Any ideas? Thanks in advance.
briann Posted March 19, 2015 Posted March 19, 2015 In case you're still looking for an idea on this...We were experiencing a similar issue in which these 401 statuses would be returned after a period of inactivity in our application (we're embedding reports using Visualize.js). Attempting to run any reports, even with the authentication username / password included every time, continued to return 401. A page refresh fixed the issue, however. We were able to catch and attempt to handle this with the error handler attached to the v.report({}) function.It appears that some of the session information is actually stored within the visualize.js script that you pull from the server before executing any reports. We found the following steps fix this issue (and can be done behind the scenes without refreshing the page or alerting the user):Catch and handle the authentication error. Set window.visualize = null.Fetch the visualize.js script from your JasperReports Server again.Execute the report again.These steps have effectively resolved our issue, though I suspect that there may be a more proper solution out there if anyone has better knowledge of the visualize.js source code and knows how this session information is stored.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now