Tomcat cannot be stopped if there's a DirectoryWatcher EventGateway

Description

On a fresh windows installation...
As soon as a DirectoryWatcher Event Gateway is added within the web-admin of a site (with default values), the Tomcat Service cannot be stopped from Service Manager, or takes about 5-10 minutes to shut down.
(see also https://dev.lucee.org/t/lucee-service-shutdown-problem-in-windows/3657)

Environment

Windows Server 2016 64bit
IIS 10
Tomcat 8.5.29
Java 1.8.0_162

Activity

Show:

Pothys - MitrahSoft 5 April 2022 at 15:06

Pothys - MitrahSoft 16 June 2021 at 15:27

This issue still can be replicated in lucee latest version 5.3.8.184-SNAPSHOT too. If event gateway is there meant, tomcat didn't close during the shutdown. And stopped event gateways are again started and still the DirectoryWatcher.log was updated for changes done in the directory. 

After Changing event gateway startup mode to manual, tomcat was closed and stopped gateways are not starting again during the shutdown.

 

DirectoryWatcher.log

"INFO","Thread-53","06/16/2021","19:35:25","lucee_context5.3.8.184-SNAPSHOT","poll testtwo stopping"  // stopped in admin "INFO","Thread-8","06/16/2021","19:35:25","lucee_context5.3.8.184-SNAPSHOT","poll testtwo stopped"   // stopped in admin "INFO","Thread-66","06/16/2021","19:35:39","lucee_context5.3.8.184-SNAPSHOT","poll testtwo running"     // during shutdown "INFO","Thread-66","06/16/2021","19:35:39","lucee_context5.3.8.184-SNAPSHOT","start testtwo Directory[D:\projects\Lucee_Core_dev\lucee_Testbox\test\testcase\docs]"     // during shutdown "INFO","Thread-66","06/16/2021","19:36:40","lucee_context5.3.8.184-SNAPSHOT","delete:{""DIRECTORY"":""D:\projects\Lucee_Core_dev\lucee_Testbox\test\testcase\docs"",""SIZE"":48,""DATELASTMODIFIED"":createDateTime(2021,4,30,14,2,51,246,""Asia/Calcutta""),""ID"":""testtwo"",""NAME"":""index.cfm"",""ACTION"":""onDelete""}"   //after shutdown "INFO","Thread-66","06/16/2021","19:36:40","lucee_context5.3.8.184-SNAPSHOT","add:{""DIRECTORY"":""D:\projects\Lucee_Core_dev\lucee_Testbox\test\testcase\docs"",""SIZE"":48,""DATELASTMODIFIED"":createDateTime(2021,4,30,14,2,51,246,""Asia/Calcutta""),""ID"":""testtwo"",""NAME"":""test.cfm"",""ACTION"":""onAdd""}"       //after shutdown

Zac Spitzer 20 August 2018 at 14:27

Pothys - MitrahSoft 2 August 2018 at 08:15

Yeah Issue is reproduced now. With latest version of snapshot. If we use watcher directory running, try to shutdown the tomcat port issue thrown on both installer and tomcat version. This happen for all small application and large size application directory watcher.

Stack Trace:

02-Aug-2018 13:15:12.190 SEVERE [Catalina-startStop-2] org.apache.catalina.core.ContainerBase.stopInternal A child container failed during stop java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:971) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1423) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1412) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:228) ... 6 more Caused by: org.apache.catalina.LifecycleException: Failed to stop component [WebappLoader[]] at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:228) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5561) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) ... 6 more Caused by: java.lang.NullPointerException at lucee.runtime.osgi.EnvClassLoader.load(EnvClassLoader.java:120) at lucee.runtime.osgi.EnvClassLoader.getResource(EnvClassLoader.java:51) at lucee.runtime.osgi.EnvClassLoader.findResource(EnvClassLoader.java:264) at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:429) at org.apache.juli.ClassLoaderLogManager$2.run(ClassLoaderLogManager.java:402) at org.apache.juli.ClassLoaderLogManager$2.run(ClassLoaderLogManager.java:398) at java.security.AccessController.doPrivileged(Native Method) at org.apache.juli.ClassLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:398) at org.apache.juli.ClassLoaderLogManager.reset(ClassLoaderLogManager.java:334) at org.apache.juli.logging.LogFactory.release(LogFactory.java:225) at org.apache.catalina.loader.WebappClassLoaderBase.clearReferences(WebappClassLoaderBase.java:1592) at org.apache.catalina.loader.WebappClassLoaderBase.stop(WebappClassLoaderBase.java:1520) at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:446) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) ... 8 more
Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 26 March 2018 at 09:33
Updated 5 April 2022 at 15:07
Resolved 28 March 2019 at 14:34

Flag notifications