How do I restart Tomcat on Windows under default lucee setup?

I always assumed that Tomcat starts/stops when the Lucee service starts/stops, but apparently this might not be the case. Is it possible that tomcat does not get restarted when Lucee is restarted?

I’m running Lucee 5.2.2.71 on Windows 7 using the default setup… ie Tomcat is under the C:\lucee directory structure, and Lucee is installed as a Windows service.

When you say “restart Lucee” do you mean the “restart” button that’s in the web administrator. I ask because most people sort of lump Lucee and Tomcat together in one ball and when they restart the entire Tomcat service, they’ll say “I just restarted Lucee”. The button in the admin does not restart Tomcat, it simply unloads Lucee from memory and reloads it. This is true of even the Lucee installer.

The web socket classes must live on the JVM outside of Lucee and not have any listeners tied to them that say “Hey, Lucee is bouncing, we’d better scoot too”. @Igal @21Solutions might be able to shed some light on that. In the meantime, I’d recommend restarting the entire Windows service as that restarts the whole of Tomcat.

I was referring to the Windows service when I said restart Lucee. How can I verify that Tomcat is indeed restarting? Good to know how the admin button works… thanks.

If you want to make sure it’s restarting, tail your catalina.out file.

If you’re restarting the Windows service then you’re restarting Tomcat, which also restarts Lucee, but for the sake of accuracy you’re restarting Tomcat which is what you want here.

If you don’t get an error then it probably restarts properly. Like Brad said checking the logs will give a more definitive answer.

You can also run a small batch script instead of using the Window GUI which will show more information if available. Something like (replace the Service name “lucee” with the correct name if it’s different):

:: filename: lucee-service-restart.bat

set SERVICE_NAME=lucee

net stop %SERVICE_NAME%
timeout 5
net start %SERVICE_NAME%

pause
1 Like

Looks like there are a few things that are not being properly stopped, which appear to be related to websockets. Here’s the tail of my catalina log file after stopping the Lucee Windows Service:

27-Aug-2017 15:16:11.005 INFO [Thread-111] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
27-Aug-2017 15:16:11.009 INFO [local.chat.com-startStop-2] org.apache.catalina.core.ApplicationContext.log org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
27-Aug-2017 15:16:11.068 WARNING [local.chat.com-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [FelixDispatchQueue] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:502)
org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:1118)
org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:55)
org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:102)
java.lang.Thread.run(Thread.java:745)
27-Aug-2017 15:16:11.069 WARNING [local.chat.com-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [FelixFrameworkWiring] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:502)
org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:172)
java.lang.Thread.run(Thread.java:745)
27-Aug-2017 15:16:11.070 WARNING [local.chat.com-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [FelixStartLevel] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:502)
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:283)
java.lang.Thread.run(Thread.java:745)
27-Aug-2017 15:16:11.143 INFO [Thread-111] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler [“http-nio-8888”]
27-Aug-2017 15:16:11.143 INFO [Thread-111] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler [“ajp-nio-8009”]