I have a javascript portal-like application (based on JPolite), when modules are loaded with $.ajax jquery call.
But the first request (when user has just started his browser) is failed with error 404. Supposing the app is hosted https://localhost:8443/context Firebug shows a开发者_如何学JAVA request to /:8443/context/file.html which is incorrect
But after refreshing browser (F5) everything works fine and request became well-formed. The same issue was in another app based on JBoss portal but fixes after migrating to the latest version.
I suppose this may be connected with incorrect caching or so. Unfortunately google did not suggest anything useful so I'd appreciate any answers.
Seems I found the solution myself. The problem was that the log was not configured properly and I missed the important record:
ERROR: org.hibernate.util.JDBCExceptionReporter - Already closed
.
After some period of inactivity mysql server closes the current connection and request was failed with AlreadyClosedException. Adding validationQuery="select 1"
to my context.xml seems fixed the issue.
After some period of inactivity mysql server closes the current connection
You should be closing connections as soon as you are finished with your database unit-of-work. Not just letting them sit idle until the SQL server closes the connection.
精彩评论