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

java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Linux

      Description

      This issue started happening since 1.446+ (meaning, 446, 447, 448). Apparently either jenkins core or some plugin is using slf4j, but neither Jenkins, nor the plugin ships with any slf4 implementations, resulting the in following stack trace on startup...

      Failed to instantiate SLF4J LoggerFactory
      Reported exception:
      java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder
      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.javCaused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
      at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1524)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
      ... 22 more

      I was able to get Jenkins to start fine by manually downloading the slf4j-simple directly from maven and putting it into WEB-INF/lib... but, without that file, Jenkins is 100% unusable.

      http://repo2.maven.org/maven2/org/slf4j/slf4j-simple/1.6.1/slf4j-simple-1.6.1.jar

        Activity

        aaronlab aaronlab created issue -
        Hide
        brant Brant Bobby added a comment - - edited

        I'm experiencing the same issue on 1.450. I've added an attachment with the winstone log output. I launched Jenkins using:

        java -jar jenkins.war --httpPort=9000 --ajp13Port=-1

        Based on the log I suspect it's the new SSHD module (introduced in 1.446) causing the problem.

        Show
        brant Brant Bobby added a comment - - edited I'm experiencing the same issue on 1.450. I've added an attachment with the winstone log output. I launched Jenkins using: java -jar jenkins.war --httpPort=9000 --ajp13Port=-1 Based on the log I suspect it's the new SSHD module (introduced in 1.446) causing the problem.
        brant Brant Bobby made changes -
        Field Original Value New Value
        Attachment winstone.log [ 21466 ]
        Hide
        kohsuke Kohsuke Kawaguchi added a comment -

        I tried this on Tomcat 6 and 7 but couldn't reproduce this. And ditto for "java -jar jenkins.war" — it works for me.

        Those who are seeing this problem, please report your environment and versions of the relevant software so that we can diagnose this problem further.

        Show
        kohsuke Kohsuke Kawaguchi added a comment - I tried this on Tomcat 6 and 7 but couldn't reproduce this. And ditto for "java -jar jenkins.war" — it works for me. Those who are seeing this problem, please report your environment and versions of the relevant software so that we can diagnose this problem further.
        Hide
        kohsuke Kohsuke Kawaguchi added a comment -

        I wonder if you are getting the older version of slf4j-api from somewhere (such as container shared library, etc.) As discussed in http://www.slf4j.org/codes.html, missing StaticLoggerBinder is no longer an error in the version we ship in Jenkins (1.6.1).

        Show
        kohsuke Kohsuke Kawaguchi added a comment - I wonder if you are getting the older version of slf4j-api from somewhere (such as container shared library, etc.) As discussed in http://www.slf4j.org/codes.html , missing StaticLoggerBinder is no longer an error in the version we ship in Jenkins (1.6.1).
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Kohsuke Kawaguchi
        Path:
        changelog.html
        maven-plugin/pom.xml
        pom.xml
        war/pom.xml
        http://jenkins-ci.org/commit/jenkins/ef1ad6ca29c313fa0b4bc6f5dcd8344046221049
        Log:
        [FIXED JENKINS-12334 JENKINS-12446 JENKINS-12650]

        Bundle slf4j binding to the war.
        See the comment in war/pom.xml for detailed discussion.

        This is fundamentally a "damned if I do, damned if I don't" situation,
        but given that JENKINS-12334 is a fatal error, and the downside of
        bundling the binding jar is "multiple binding" warning, it seems like
        the lesser evil is to bundle it and risk some warnings.

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html maven-plugin/pom.xml pom.xml war/pom.xml http://jenkins-ci.org/commit/jenkins/ef1ad6ca29c313fa0b4bc6f5dcd8344046221049 Log: [FIXED JENKINS-12334 JENKINS-12446 JENKINS-12650] Bundle slf4j binding to the war. See the comment in war/pom.xml for detailed discussion. This is fundamentally a "damned if I do, damned if I don't" situation, but given that JENKINS-12334 is a fatal error, and the downside of bundling the binding jar is "multiple binding" warning, it seems like the lesser evil is to bundle it and risk some warnings.
        kohsuke Kohsuke Kawaguchi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Kohsuke Kawaguchi [ kohsuke ]
        Resolution Fixed [ 1 ]
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Kohsuke Kawaguchi
        Path:
        maven-plugin/pom.xml
        pom.xml
        war/pom.xml
        http://jenkins-ci.org/commit/jenkins/7cc71cd78ea5839bec9a4c881c00751dde9b5b5a
        Log:
        [FIXED JENKINS-12334 JENKINS-12446 JENKINS-12650]

        Bundle slf4j binding to the war.
        See the comment in war/pom.xml for detailed discussion.

        This is fundamentally a "damned if I do, damned if I don't" situation,
        but given that JENKINS-12334 is a fatal error, and the downside of
        bundling the binding jar is "multiple binding" warning, it seems like
        the lesser evil is to bundle it and risk some warnings.

        Cherry-picked-from: ef1ad6ca29c313fa0b4bc6f5dcd8344046221049

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: maven-plugin/pom.xml pom.xml war/pom.xml http://jenkins-ci.org/commit/jenkins/7cc71cd78ea5839bec9a4c881c00751dde9b5b5a Log: [FIXED JENKINS-12334 JENKINS-12446 JENKINS-12650] Bundle slf4j binding to the war. See the comment in war/pom.xml for detailed discussion. This is fundamentally a "damned if I do, damned if I don't" situation, but given that JENKINS-12334 is a fatal error, and the downside of bundling the binding jar is "multiple binding" warning, it seems like the lesser evil is to bundle it and risk some warnings. Cherry-picked-from: ef1ad6ca29c313fa0b4bc6f5dcd8344046221049
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Kohsuke Kawaguchi
        Path:
        pom.xml
        http://jenkins-ci.org/commit/maven-plugin/40034fea378dba1fee10a57493981a937433dfe6
        Log:
        [FIXED JENKINS-12334 JENKINS-12446 JENKINS-12650]

        Bundle slf4j binding to the war.
        See the comment in war/pom.xml for detailed discussion.

        This is fundamentally a "damned if I do, damned if I don't" situation,
        but given that JENKINS-12334 is a fatal error, and the downside of
        bundling the binding jar is "multiple binding" warning, it seems like
        the lesser evil is to bundle it and risk some warnings.

        Originally-Committed-As: ef1ad6ca29c313fa0b4bc6f5dcd8344046221049

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: pom.xml http://jenkins-ci.org/commit/maven-plugin/40034fea378dba1fee10a57493981a937433dfe6 Log: [FIXED JENKINS-12334 JENKINS-12446 JENKINS-12650] Bundle slf4j binding to the war. See the comment in war/pom.xml for detailed discussion. This is fundamentally a "damned if I do, damned if I don't" situation, but given that JENKINS-12334 is a fatal error, and the downside of bundling the binding jar is "multiple binding" warning, it seems like the lesser evil is to bundle it and risk some warnings. Originally-Committed-As: ef1ad6ca29c313fa0b4bc6f5dcd8344046221049

          People

          • Assignee:
            kohsuke Kohsuke Kawaguchi
            Reporter:
            aaronlab aaronlab
          • Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: