Could not load Logmanager


(Sebastian Peters) #1

I’m setting up a HelloWorld Java project on Jenkins 2 that runs on Tomcat 7, which is supposed to trigger a simple Gradle 3 task. So far so good, the build is going fine. However, every time I build I get an immense error log of an apparent Logmanager being unable to get loaded (note that the actual log expands three times this size):

00:00:00.993 Starting Gradle Build...
00:00:00.997 [Gradle] - Launching build.
00:00:00.999 [gradletest] $ cmd.exe /C "C:\Users\selbi\.jenkins\workspace\gradletest\gradlew.bat build && exit %%ERRORLEVEL%%"
00:00:01.426 Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
00:00:01.427 java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
00:00:01.427     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
00:00:01.427     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
00:00:01.428     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
00:00:01.428     at java.util.logging.LogManager$1.run(LogManager.java:195)
00:00:01.428     at java.util.logging.LogManager$1.run(LogManager.java:181)
00:00:01.428     at java.security.AccessController.doPrivileged(Native Method)
00:00:01.428     at java.util.logging.LogManager.<clinit>(LogManager.java:181)
00:00:01.428     at java.util.logging.Logger.demandLogger(Logger.java:448)
00:00:01.428     at java.util.logging.Logger.getLogger(Logger.java:502)
00:00:01.428     at org.gradle.internal.logging.source.JavaUtilLoggingSystem.<init>(JavaUtilLoggingSystem.java:34)
00:00:01.428     at org.gradle.internal.logging.services.LoggingServiceRegistry.createLoggingManagerFactory(LoggingServiceRegistry.java:134)
00:00:01.428     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
00:00:01.428     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
00:00:01.428     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:00:01.428     at java.lang.reflect.Method.invoke(Method.java:498)
00:00:01.428     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
00:00:01.428     at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:462)
00:00:01.428     at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:84)
00:00:01.429     at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:796)
00:00:01.429     at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:752)
00:00:01.429     at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:589)
00:00:01.429     at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:634)
00:00:01.429     at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:429)
00:00:01.429     at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:410)
00:00:01.429     at org.gradle.internal.logging.services.LoggingServiceRegistry.newCommandLineProcessLogging(LoggingServiceRegistry.java:69)
00:00:01.429     at org.gradle.launcher.cli.CommandLineActionFactory.createLoggingServices(CommandLineActionFactory.java:90)
00:00:01.429     at org.gradle.launcher.cli.CommandLineActionFactory.convert(CommandLineActionFactory.java:67)
00:00:01.429     at org.gradle.launcher.Main.doAction(Main.java:33)
00:00:01.429     at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
00:00:01.429     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
00:00:01.429     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
00:00:01.429     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:00:01.429     at java.lang.reflect.Method.invoke(Method.java:498)
00:00:01.429     at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
00:00:01.429     at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
00:00:01.429     at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
00:00:01.429     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
00:00:01.429     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
00:00:01.429     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:00:01.429     at java.lang.reflect.Method.invoke(Method.java:498)
00:00:01.429     at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
00:00:01.429     at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
00:00:01.429     at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

I was able to find this post in the old forum already, which describes almost exactly the same problem I got, but the topic cuts off without a solution. Reading up into other places, I’ve tried setting my environment variables via Jenkins shell script before the Gradle build, but that didn’t fix this error.