Bug 60366

Summary: catalina.bat should not modify $JAVA_OPTS to add $LOGGING_MANAGER
Product: Tomcat 8 Reporter: Petter Isberg <icermann>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: normal CC: 1983-01-06
Priority: P2    
Version: 8.5.8   
Target Milestone: ----   
Hardware: PC   
OS: All   

Description Petter Isberg 2016-11-13 20:59:14 UTC
catalina.bat adds logging manager and logging configuration parameters to JAVA_OPTS. This can cause issues when sub-processes are spawned. As far as I understand, the sub-process tries to use java.util.logging but throws an ClassNotFoundException because org.apache.juli.ClassLoaderLogManager is not on classpath.

This has already been solved for catalina.sh back in 2013, see bug 54601 for further explanations (https://bz.apache.org/bugzilla/show_bug.cgi?id=54601)

The same issuses as described in bug 54601, with Jenkins and Gradle, are still present in the Windows version of Tomcat 8.5.8. Since the catalina.bat file looks the same in this regard for tomcat 7 and 9 it is reasonable to believe these versions are affected as well.

A solution similar to the one for catalina.sh solves the issue for me.

Remove the assignments to JAVA_OPTS in lines 213 and 218 and add the LOGGING_CONFIG and LOGGING_MANAGER variables to where the JAVA_OPTS is used in lines 336, 339, 343, 346

208 if not "%LOGGING_CONFIG%" == "" goto noJuliConfig
209 set LOGGING_CONFIG=-Dnop
210 if not exist "%CATALINA_BASE%\conf\logging.properties" goto noJuliConfig
211 set LOGGING_CONFIG=-Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
212 :noJuliConfig
215 if not "%LOGGING_MANAGER%" == "" goto noJuliManager
216 set LOGGING_MANAGER=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
217 :noJuliManager

Comment 1 Violeta Georgieva 2016-11-17 19:44:12 UTC

Thanks for the report and the patch.
This has been fixed in
- 9.0.x for 9.0.0.M14 onwards
- 8.5.x for 8.5.9 onwards
- 8.0.x for 8.0.40 onwards and
- 7.0.x for 7.0.74 onwards