Description of problem: In static {} blocks of BaseServlet and BaseFilter, there is the following code: if (!SessionManager.hasSession("default")) { new Startup().run(); } The 'hasSession' method looks in the Map returned by getSessions(), however. This entries in this map are created when SessionManager#open is invoked. Unfortuntely, the Startup#run method only ever invokes SessionManager#configure so the map is never populated. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Run if (!SessionManager.hasSession("default")) { new Startup().run(); } if (!SessionManager.hasSession("default")) { new Startup().run(); } Yes, twice in a row. 2. 3. Actual results: java.lang.ExceptionInInitializerError: java.lang.IllegalArgumentException: already configured: startup at com.arsdigita.persistence.SessionManager.configure(SessionManager.java:98) at com.arsdigita.runtime.Startup.session(Startup.java:179) at com.arsdigita.runtime.Startup.getRuntimeInitializerNames(Startup.java:144) at com.arsdigita.runtime.Startup.addRuntimeInitializers(Startup.java:123) at com.arsdigita.runtime.Startup.run(Startup.java:226) at com.arsdigita.web.BaseFilter.<clinit>(BaseFilter.java:57) at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Class.java(Compiled Code)) at com.caucho.server.http.QFilterConfig.createFilter(QFilterConfig.java:205) at com.caucho.server.http.Application.buildFilterChain(Application.java:2862) at com.caucho.server.http.Application.buildFilterChain(Application.java:2764) at com.caucho.server.http.Invocation.service(Invocation.java:313) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246) at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163) at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at java.lang.Thread.run(Thread.java:513) Expected results: The second call to Startup#run is never done, since SessionManager already has the default session configured. Additional info:
I've had to temporarily disable the 'static' initializer in BaseFilter (p4 38355) untill this is resolve, since it is blocking successful startup.
Note for Jon if/when he gets around to testing this: BaseFilter has zero (0) afferent dependencies in Core+CMS. See bug 99096, comment #3.
BaseFilter is used by PS code. Its purpose is similar to BaseServlet, in that it ensures that persistence session is initialized before the body of the filter is run.
fixed @39141
This has broken the CCM load command. The problem is that 's_hasRun' is set at the end of the run method, however, one of the initializers for CMS causes ContentItem class to be loaded, which in turn loads the BaseServlet classs, which in turn checks the s_hasRun attribute - which is still false & so it calls run again - recursively. This is trivally fixed by moving 's_hasRun = true' to the start of the method.
Created attachment 96808 [details] Logs from startup sequence
Ah, fixed @39202.