Dean
12/31/2022, 10:02 PMBad Gateway (502) . The Lucee admin is also not available for some minutes, but if I wait for that to become available, then I call our refresh URL, everything works fine. Instance is running under Commandbox 5.7 on Windows. More logging info in thread....Dean
12/31/2022, 10:05 PM"INFO","on-start-1","01/01/2023","08:58:28","","Lucee starting instance"
"INFO","on-start-1","01/01/2023","08:58:31","","Check <http://myurl.com/index.cfm|myurl.com/index.cfm> returned: Bad Gateway (502)"
"INFO","on-start-1","01/01/2023","08:58:31","","Calling the refresh url because it seems the site borked"
"INFO","on-start-1","01/01/2023","08:58:32","","Refresh URL returned: Bad Gateway (502)"
from server/application.log
"DEBUG","main","01/01/2023","08:58:26","OSGi","Start bundle: [org.lucee.ehcache:2.10.3]"
"INFO","main","01/01/2023","08:58:26","startup","touched monitors"
"INFO","main","01/01/2023","08:58:26","startup","Start CFML Controller"
"INFO","main","01/01/2023","08:58:26","add-event-listener","UT010041: The servlet context has already been initialized, you can only call this method from a ServletContainerInitializer or a ServletContextListener;java.lang.IllegalStateException: UT010041: The servlet context has already been initialized, you can only call this method from a ServletContainerInitializer or a ServletContextListener
at io.undertow.servlet.spec.ServletContextImpl.ensureNotInitialized(ServletContextImpl.java:1030)
at io.undertow.servlet.spec.ServletContextImpl.addListener(ServletContextImpl.java:745)
at lucee.runtime.engine.CFMLEngineImpl.addEventListener(CFMLEngineImpl.java:849)
at lucee.runtime.engine.CFMLEngineImpl.addServletConfig(CFMLEngineImpl.java:794)
at lucee.loader.engine.CFMLEngineWrapper.addServletConfig(CFMLEngineWrapper.java:87)
at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:169)
at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:202)
at lucee.loader.servlet.LuceeServlet.init(LuceeServlet.java:42)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:309)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:588)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:559)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:601)
at runwar.Server.createServletDeployment(Server.java:1360)
at runwar.Server.startServer(Server.java:527)
at runwar.Start.main(Start.java:51)
"
"INFO","main","01/01/2023","08:58:26","startup","Lucee was not able to register an event listener with io.undertow.servlet.spec.ServletContextImpl"
"INFO","main","01/01/2023","08:58:26","startup","load Context"
"INFO","main","01/01/2023","08:58:26","startup","got context directory"
"INFO","main","01/01/2023","08:58:26","startup","init factory"
"INFO","main","01/01/2023","09:02:21","startup","loaded config"
"INFO","main","01/01/2023","09:02:21","add-event-listener","UT010041: The servlet context has already been initialized, you can only call this method from a ServletContainerInitializer or a ServletContextListener;java.lang.IllegalStateException: UT010041: The servlet context has already been initialized, you can only call this method from a ServletContainerInitializer or a ServletContextListener
at io.undertow.servlet.spec.ServletContextImpl.ensureNotInitialized(ServletContextImpl.java:1030)
at io.undertow.servlet.spec.ServletContextImpl.addListener(ServletContextImpl.java:745)
at lucee.runtime.engine.CFMLEngineImpl.addEventListener(CFMLEngineImpl.java:849)....Dean
12/31/2022, 10:14 PM"INFO","Thread-60","01/01/2023","09:09:50","","Lucee starting instance"
"INFO","XNIO-1 task-1","01/01/2023","09:09:54","","E:\webs\dev\www\ControlPanel\Server.cfc, "
"INFO","XNIO-1 task-1","01/01/2023","09:09:54","","serverKey: e:\webs\dev\, "
"INFO","XNIO-1 task-1","01/01/2023","09:10:17","","serverKey: e:\webs\dev\, "
"INFO","Thread-60","01/01/2023","09:10:34","","Check <http://myurl.com/index.cfm|myurl.com/index.cfm> returned: OK (200)"
"INFO","Thread-60","01/01/2023","09:10:41","","Check myurl/index.cfm returned: OK (200)"
"INFO","main","01/01/2023","09:09:49","startup","Lucee was not able to register an event listener with io.undertow.servlet.spec.ServletContextImpl"
"INFO","main","01/01/2023","09:09:49","startup","load Context"
"INFO","main","01/01/2023","09:09:49","startup","got context directory"
"INFO","main","01/01/2023","09:09:49","startup","init factory"
"INFO","main","01/01/2023","09:09:50","startup","loaded config"
"INFO","main","01/01/2023","09:09:50","add-event-listener","UT010041: The servlet context has already been initialized, you can only call this method from a ServletContainerInitializer or a ServletContextListener;java.lang.IllegalStateException: UT010041: The servlet context has already been initialized, you can only call this method from a ServletContainerInitializer or a ServletContextListenerDean
12/31/2022, 10:31 PM[ERROR] runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
and
[DEBUG] runwar.server: New servlet context created for [default]
Was approximately 4 minutesDean
12/31/2022, 10:31 PMbdw429s
12/31/2022, 10:41 PMbdw429s
12/31/2022, 10:41 PMDean
12/31/2022, 10:41 PMbdw429s
12/31/2022, 10:42 PMbdw429s
12/31/2022, 10:43 PMbdw429s
12/31/2022, 10:43 PMserver set runwar.args='--log-pattern "[%-5p] %d{dd MMM yyyy HH:mm:ss.SSS} %c: %m%n"'Dean
12/31/2022, 10:43 PMDean
12/31/2022, 10:53 PM[INFO ] 01 Jan 2023 09:44:50.337 runwar.context: [INFO] Http service whiteboard started
[ERROR] 01 Jan 2023 09:44:51.147 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 01 Jan 2023 09:44:53.942 runwar.server: New servlet context created for [default]
[DEBUG] 01 Jan 2023 09:44:53.945 runwar.server: started servlet deployment manager
5.3.10:
[INFO ] 01 Jan 2023 09:47:04.713 runwar.context: [INFO] Http service whiteboard started
[ERROR] 01 Jan 2023 09:47:05.554 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 01 Jan 2023 09:51:13.309 runwar.server: New servlet context created for [default]
[DEBUG] 01 Jan 2023 09:51:13.310 runwar.server: started servlet deployment managerDean
12/31/2022, 11:03 PM[ERROR] 01 Jan 2023 09:57:32.410 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 01 Jan 2023 09:57:52.947 runwar.server: New servlet context created for [default]
Assuming this is the build time for the instance, e.g. unzipping the WEB-INF etc
But on next start:
[ERROR] 01 Jan 2023 10:01:55.824 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 01 Jan 2023 10:01:58.572 runwar.server: New servlet context created for [default]bdw429s
12/31/2022, 11:23 PMbdw429s
12/31/2022, 11:23 PMDean
12/31/2022, 11:44 PMbdw429s
12/31/2022, 11:57 PMbdw429s
12/31/2022, 11:58 PMDean
12/31/2022, 11:58 PMDean
01/01/2023, 12:04 AM[ERROR] 01 Jan 2023 11:00:42.570 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 01 Jan 2023 11:00:45.559 runwar.server: New servlet context created for [default]
So that would suggest that the server start is reliant on the web.cfc completing, which doesnt make sense because I thought the web.cfc was initiated after the web context was available (which is why we use it to run a warmup url)Dean
01/01/2023, 12:05 AMbdw429s
01/01/2023, 12:09 AMDean
01/01/2023, 12:09 AMDean
01/01/2023, 12:12 AM2023/01/01 10:52:40 [error] 8672#6748: *193695 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 127.0.0.1bdw429s
01/01/2023, 12:13 AMDean
01/01/2023, 12:16 AMDean
01/04/2023, 9:59 AMgavinbaumanis
01/05/2023, 2:43 AMzackster
01/05/2023, 10:04 AMDean
01/06/2023, 12:04 AM[ERROR] 06 Jan 2023 10:54:52.041 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 06 Jan 2023 10:59:00.595 runwar.server: New servlet context created for [default]Dean
01/06/2023, 12:29 AM[ERROR] 06 Jan 2023 11:24:07.135 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 06 Jan 2023 11:28:14.808 runwar.server: New servlet context created for [default]zackster
01/06/2023, 10:44 AMDean
01/07/2023, 9:42 PMweb.cfc in the web context directory
component {
public function onWebStart(reload) {
fileAppend(filepath="#expandPath('{lucee-web}')#\..\..\logs\server.out.txt", data= "#lsDateTimeFormat(now(),"iso")# starting web.cfc#(chr(10))#")
sleep(120000)
fileAppend(filepath="#expandPath('{lucee-web}')#\..\..\logs\server.out.txt", data= "#lsDateTimeFormat(now(), "iso")# ending web.cfc#(chr(10))#")
}
}
produces the following result for 5.3.10
[INFO ] 08 Jan 2023 08:39:06.033 runwar.context: [INFO] Http service whiteboard started
[ERROR] 08 Jan 2023 08:39:06.916 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
2023-01-08T08:39:17+11:00 starting web.cfc
2023-01-08T08:41:17+11:00 ending web.cfc
[DEBUG] 08 Jan 2023 08:41:17.627 runwar.server: New servlet context created for [default]
[DEBUG] 08 Jan 2023 08:41:17.629 runwar.server: started servlet deployment manager
[DEBUG] 08 Jan 2023 08:41:17.629 runwar.server: Direct Buffers: true
and on 5.3.9
[INFO ] 08 Jan 2023 08:30:32.267 runwar.context: [INFO] Http service whiteboard started
[ERROR] 08 Jan 2023 08:30:33.142 runwar.context: [ERROR] LogFactory: Load of custom hashtable failed
[DEBUG] 08 Jan 2023 08:30:50.654 runwar.server: New servlet context created for [default]
[DEBUG] 08 Jan 2023 08:30:50.657 runwar.server: started servlet deployment manager
[DEBUG] 08 Jan 2023 08:30:50.657 runwar.server: Direct Buffers: true
2023-01-08T08:30:50+11:00 starting web.cfc
....{bunch of unrelated log entries}....
2023-01-08T08:32:50+11:00 ending web.cfcDean
03/26/2023, 1:05 AMonWebStart() needs to have access to the initialised web context, but in 5.3.10 this seems to wait for the onWebStart() to complete before coming up.
If I set a rather long sleep, say 2 minutes, I get:
lucee-docker-test-lucee5310-1 | [INFO] 2023-03-26T00:57:56Z runwar.context - Start web.cfc
lucee-docker-test-lucee5310-1 | [ERROR] 2023-03-26T00:58:26Z runwar.context - lucee.runtime.exp.NativeException: sleep interrupted
Assuming this is by design for 5.3.10, is it possible to have something like onWebContextLoaded() ? @zacksterzackster
03/27/2023, 11:23 AMweb.cfc and server.cfc are as (I think) are only intended to be for the before the context is initialized, so your suggestion makes sense.Dean
03/27/2023, 10:23 PM