Community
Participate
Working Groups
This seems to happen very rarely when refreshing the page with F5. Frank has noticed it once some weeks ago, I got it only once yet. In my case, the browser was Chromium/Linux. java.lang.IllegalStateException: SingletonManager already installed for session: 16hhf4n4i7a5q1inizl1jzpees at org.eclipse.rwt.internal.SingletonManager.checkNotInstalled(SingletonManager.java:70) at org.eclipse.rwt.internal.SingletonManager.install(SingletonManager.java:27) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.clearSessionStore(LifeCycleServiceHandler.java:139) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.checkRequest(LifeCycleServiceHandler.java:126) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:72) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:55) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:45) at org.eclipse.rwt.internal.service.ServiceManager$HandlerDispatcher.service(ServiceManager.java:34) at org.eclipse.rwt.internal.engine.RWTDelegate.handleValidRequest(RWTDelegate.java:62) at org.eclipse.rwt.internal.engine.RWTDelegate.doPost(RWTDelegate.java:41) at org.eclipse.rwt.internal.engine.RWTDelegate.doGet(RWTDelegate.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(CutOffContextPathWrapper.java:103) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
The exception is the same like in bug 340742 comment #6. To reproduce it 100%: 1. Start Workbench Demo 2. Choose File -> Exit. 3. Refresh with F5.
I see the exception when running RWT standalone along with requests for non-existing resources Jetty prints a message like WARN::/rwt-resources/themes/images/ec0d88bb followed by the exception It is not yet clear to me why the resources cannot be found but it seems that the resource requests (incompletely) clear the session.
Created attachment 204804 [details] Test case I think the source of the problem is that LifeCycleServiceHandler#clearSessionStore() is unsynchronized. At least I have a failing test case and synchronizing the method lets the test succeed. I observed not only the mentioned exception but a number of different exceptions in different places.
Please disregard comment #3, totally wrong. LifeCycleServiceHandler#clearSessionStore() *is* synchronized as there is a sync-lock around the whole service() method.
*** Bug 368224 has been marked as a duplicate of this bug. ***
We ran into this bug also with Android client. Here is the StackTrace: osgi> 2012-01-26 15:05:52.079:WARN:oejs.ServletHandler:ERROR: /randy java.lang.IllegalStateException: SingletonManager already installed for session: 1d6oe6qhneol41saskicqca6ga at org.eclipse.rwt.internal.SingletonManager.checkNotInstalled(SingletonManager.java:70) at org.eclipse.rwt.internal.SingletonManager.install(SingletonManager.java:27) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.clearSessionStore(LifeCycleServiceHandler.java:139) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.checkRequest(LifeCycleServiceHandler.java:126) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:76) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:59) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:49) at org.eclipse.rwt.internal.service.ServiceManager$HandlerDispatcher.service(ServiceManager.java:34) at org.eclipse.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:68) at org.eclipse.rwt.engine.RWTServlet.doPost(RWTServlet.java:47) at org.eclipse.rwt.engine.RWTServlet.doGet(RWTServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(CutOffContextPathWrapper.java:105) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:323) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:575) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1061) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:995) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:350) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:431) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:896) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:233) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:68) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533) at java.lang.Thread.run(Thread.java:662) 2012-01-26 15:05:53.124:WARN:oejs.ServletHandler:ERROR: /randy java.lang.IllegalStateException: SingletonManager already installed for session: 1d6oe6qhneol41saskicqca6ga at org.eclipse.rwt.internal.SingletonManager.checkNotInstalled(SingletonManager.java:70) at org.eclipse.rwt.internal.SingletonManager.install(SingletonManager.java:27) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.clearSessionStore(LifeCycleServiceHandler.java:139) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.checkRequest(LifeCycleServiceHandler.java:126) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:76) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:59) at org.eclipse.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:49) at org.eclipse.rwt.internal.service.ServiceManager$HandlerDispatcher.service(ServiceManager.java:34) at org.eclipse.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:68) at org.eclipse.rwt.engine.RWTServlet.doPost(RWTServlet.java:47) at org.eclipse.rwt.engine.RWTServlet.doGet(RWTServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(CutOffContextPathWrapper.java:105) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:323) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:575) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1061) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:995) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:350) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:431) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:896) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:233) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:68) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533) at java.lang.Thread.run(Thread.java:662)
Created attachment 211281 [details] Entry point to reproduce the issue with RAP 1.5 Finally, I've managed to trace down the problem. Here is an entry point to reproduce the issue: 1. Start the entry point as RAP application. 2. Close the shell - click on the shell "X" button. 3. Press browser F5 to restart the session.
Another way to reproduce it: 1. Start the Workbench Demo 2. Close the main shell – click on the shell "X" button. 3. Press CTRL+S (this is a know key binding for editor save) 4. Press browser F5 to restart the session. In both cases there is a request sent after the server-side main shell is disposed (main read & dispatch loop has been left and display.sleep() is not called anymore). This request wakeup the UIThread, which is currently waiting for session timeout to die (UIThreadTerminatedError) and to clear the session store. As a result - the session store is not cleared.
Created attachment 211324 [details] Proposed patch This patch prevents the UI thread from waking up if it is waiting to die.
Created attachment 211325 [details] Proposed patch This is the previous patch with fixed typo in the constant name.
Created attachment 211333 [details] Proposed patch JUnit test has been added to the previous patch.
Applied last patch to CVS HEAD with minor constant name change.