Tomcat won't stop

I noticed this issue in Search, but other modules might have the same problem. `Cobalt Infrastructure Logging` seems to be using the Log4J's 'PropertyConfigurator.configureAndWatch' method. This is shown in the link below, look for `configureAndWatch`. [LoggingInitializer](
http://tfsnpt.int.thomson.com:8080/tfs/web/UI/Pages/Scc/
ViewSource.aspx?path=%24%2FCobalt%20Infrastructure%2FDevelopment%2FLogging%2FJava%2Fsrc%2Fcom%2Ftrgr%2Fcobalt%2Finfrastructure%2Flogging%2FLoggingInitializer.java&cs=480791&pguid=6dd7203b-86f0-49ce-a68f-135e4d34f2ce) This method apparently wasn't implemented to listen to Interruptions properly as the issue below, which has been open for 13 years, shows. The result is that when your IDE calls shutdown on tomcat, `FileWatchdog` goes rogue and refuses to comply, leaving tomcat to timeout and you to kill the JVM instance. [
https://issues.apache.org/bugzilla/show_bug.cgi?id=4913](https://issues.apache.org/bugzilla/show_bug.cgi?id=4913) There seems to be a workaround and I have tried it unsuccessfully. I am attaching the links here for archiving. [Log4j and web application thread leaks](
http://mmartinsoftware.blogspot.com/2013/09/log4j-and-web-application-thread-leaks.html) [Log4j 2 fixes auto reconfigure thread](
http://mmartinsoftware.blogspot.com/2013/09/log4j-2-fixes-auto-reconfigure-thread.html) This becomes an issue for server restarts in the IDE. In the case of Netbeans, you'll have issues starting the server after you kill it manually. The work around for that is to delete the `${TOMCAT_HOME}/logs` and `${TOMCAT_HOME}/conf/Catalina/localhost` directories and the restart. This seems to work. 2¢: I don't know what the implications would be for `Cobalt Infrastructure Logging`, but humbly I add, that they should use `SLF4J` and give the liberty of Logging implementation to the modules that depend on `Cobalt Infrastructure Logging`. Thanks to __Eric Milles__ for the help.

Best Answer

  • I'd like to second the suggestion to use `SLF4J`. It would make something like switching from Log4j to Log4j 2 (or any other logging library, for that matter) trivial.