Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"

在Jenkins中利用Gradle编译项目时,可能会出现以下错误

 

Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"

 

 

原因

Jenkins的Gradle Plugin拷贝所有Tomcat的环境变量到Gradle的JVM中,因此Gradle在使用JAVA_OPTS 作为合法参数时可能机会有下面这些问题

 

Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)

 

 

解决办法:

打开Tomcat bin目录下catalina.bat,注销下面代码:

 

rem set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%"
rem set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"

 

 

你可能感兴趣的:(tomcat,Jenkins,gradle)