Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31799

Errors during gradlew server command

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: gradle-jpi-plugin
    • Labels:
    • Environment:
      Java 1.7, Gradle 2.7, Jenkins 1.509.3
    • Similar Issues:

      Description

      After I moved from Maven to Gradle I started getting errors during server startup via gradlew server command. I did not see these errors with mvn hpi:run

      The errors disappear if I don`t use Gradle daemon.

      Failed to instantiate SLF4J LoggerFactory
      Reported exception:
      java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              at winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:55)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
              at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
              at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
              at org.apache.sshd.common.AbstractFactoryManager.<init>(AbstractFactoryManager.java:40)
              at org.apache.sshd.SshServer.<init>(SshServer.java:144)
              at org.apache.sshd.SshServer.setUpDefaultServer(SshServer.java:446)
              at org.jenkinsci.main.modules.sshd.SSHD.start(SSHD.java:82)
              at org.jenkinsci.main.modules.sshd.SSHD.init(SSHD.java:144)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at hudson.init.InitializerFinder.invoke(InitializerFinder.java:120)
              at hudson.init.InitializerFinder$TaskImpl.run(InitializerFinder.java:184)
              at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
              at jenkins.model.Jenkins$7.runTask(Jenkins.java:888)
              at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
              at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.ClassNotFoundException: org.slf4j.spi.LoggerFactoryBinder
              at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              ... 37 more
      Failed SSHD.init
      java.lang.Error: java.lang.reflect.InvocationTargetException
              at hudson.init.InitializerFinder.invoke(InitializerFinder.java:124)
              at hudson.init.InitializerFinder$TaskImpl.run(InitializerFinder.java:184)
              at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
              at jenkins.model.Jenkins$7.runTask(Jenkins.java:888)
              at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
              at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at hudson.init.InitializerFinder.invoke(InitializerFinder.java:120)
              ... 8 more
      Caused by: java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              at winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:55)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
              at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
              at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
              at org.apache.sshd.common.AbstractFactoryManager.<init>(AbstractFactoryManager.java:40)
              at org.apache.sshd.SshServer.<init>(SshServer.java:144)
              at org.apache.sshd.SshServer.setUpDefaultServer(SshServer.java:446)
              at org.jenkinsci.main.modules.sshd.SSHD.start(SSHD.java:82)
              at org.jenkinsci.main.modules.sshd.SSHD.init(SSHD.java:144)
              ... 13 more
      Caused by: java.lang.ClassNotFoundException: org.slf4j.spi.LoggerFactoryBinder
              at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              ... 37 more
      Exception in thread "Monitoring master for Free Swap Space" java.lang.UnsatisfiedLinkError: com.sun.jna.Native.malloc(J)J
              at com.sun.jna.Native.malloc(Native Method)
              at com.sun.jna.Memory.malloc(Memory.java:690)
              at com.sun.jna.Memory.<init>(Memory.java:79)
              at com.sun.jna.Structure$AutoAllocated.<init>(Structure.java:1366)
              at com.sun.jna.Structure.autoAllocate(Structure.java:231)
              at com.sun.jna.Structure.allocateMemory(Structure.java:302)
              at com.sun.jna.Structure.<init>(Structure.java:179)
              at com.sun.jna.Structure.<init>(Structure.java:169)
              at com.sun.jna.Structure.<init>(Structure.java:165)
              at com.sun.jna.Structure.<init>(Structure.java:156)
              at org.jvnet.hudson.Windows$MEMORYSTATUSEX.<init>(Windows.java:55)
              at org.jvnet.hudson.Windows.monitor(Windows.java:40)
              at hudson.node_monitors.SwapSpaceMonitor$MonitorTask.call(SwapSpaceMonitor.java:109)
              at hudson.node_monitors.SwapSpaceMonitor$MonitorTask.call(SwapSpaceMonitor.java:99)
              at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
              at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:83)
              at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:81)
              at hudson.node_monitors.AbstractNodeMonitorDescriptor$Record.run(AbstractNodeMonitorDescriptor.java:219)
      There was an OPT answer. Not currently handled. Option code: 65002 data: 957552C761332C27
      

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          Do you have a public repo that I can use for reproducing the issue?

          For a workaround, you can try to add the SLF4J API to the runtime dependencies in your project:

          runtime 'org.slf4j:slf4j-api:1.7.13'
          
          Show
          daspilker Daniel Spilker added a comment - Do you have a public repo that I can use for reproducing the issue? For a workaround, you can try to add the SLF4J API to the runtime dependencies in your project: runtime 'org.slf4j:slf4j-api:1.7.13'
          Hide
          sergeyk Sergey Kadaner added a comment - - edited

          There is already slf4j-api-1.6.2.jar and slf4j-jdk14-1.6.2.jar under work/war/WEB-INF/lib directory. However the same directory is used by Maven plugin, so it should not be the problem.

          The workaround you suggested did not help.

          I currently cannot provide sources of the project, but I may be able to do it later.

          Show
          sergeyk Sergey Kadaner added a comment - - edited There is already slf4j-api-1.6.2.jar and slf4j-jdk14-1.6.2.jar under work/war/WEB-INF/lib directory. However the same directory is used by Maven plugin, so it should not be the problem. The workaround you suggested did not help. I currently cannot provide sources of the project, but I may be able to do it later.
          Hide
          sergeyk Sergey Kadaner added a comment -
          Show
          sergeyk Sergey Kadaner added a comment - The plugin is available now at https://github.com/jenkinsci/checkmarx-plugin.git
          Hide
          daspilker Daniel Spilker added a comment -

          I just cloned you plugin and I can not reproduce the problem. Are there additional steps required to reproduce the problem?

          Show
          daspilker Daniel Spilker added a comment - I just cloned you plugin and I can not reproduce the problem. Are there additional steps required to reproduce the problem?
          Hide
          sergeyk Sergey Kadaner added a comment - - edited

          Yes.
          I noticed recently that the errors disappear if I don`t use Gradle daemon, so I turned it off by default.
          I already updated the description accordingly.

          Edit: disabling the daemon also allows to connect to the process and debug the plugin. With daemon debugger was never stopping on breakpoints.

          Show
          sergeyk Sergey Kadaner added a comment - - edited Yes. I noticed recently that the errors disappear if I don`t use Gradle daemon, so I turned it off by default. I already updated the description accordingly. Edit: disabling the daemon also allows to connect to the process and debug the plugin. With daemon debugger was never stopping on breakpoints.
          Hide
          sghill Steve Hill added a comment -

          Closing this out as there has been no activity in over 2 years and several major releases of gradle have happened since then. If it's still an issue, feel free to re-open.

           

          As for debugging with the gradle daemon, you can use the org.gradle.debug=true system property as documented here.

          Show
          sghill Steve Hill added a comment - Closing this out as there has been no activity in over 2 years and several major releases of gradle have happened since then. If it's still an issue, feel free to re-open.   As for debugging with the gradle daemon, you can use the org.gradle.debug=true system property as documented here .

            People

            Assignee:
            daspilker Daniel Spilker
            Reporter:
            sergeyk Sergey Kadaner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: