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

monitoring-plugin installation fails because of old log4j-over-slf4j.jar

    Details

    • Similar Issues:

      Description

      Please update log4-over-slf4j to at least 1.7.21:

      https://github.com/javamelody/javamelody/issues/566

      the log4j-over-slf4j-1.7.7.jar brought by jenkins 2.60.3 makes it impossible to install monitoring-plugin when jenkins running in tomcat.

      env. tomcat-8.0.43-28.2 on sles 12 sp2 x64.

      java.lang.NoSuchMethodError: net.bull.javamelody.Log4JAppender.setThreshold(Lorg/apache/log4j/Priority;)V

              at net.bull.javamelody.Log4JAppender.<init>(Log4JAppender.java:42)

              at net.bull.javamelody.Log4JAppender.<clinit>(Log4JAppender.java:34)

              at net.bull.javamelody.FilterContext.initLogs(FilterContext.java:313)

              at net.bull.javamelody.FilterContext.<init>(FilterContext.java:95)

              at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:142)

              at net.bull.javamelody.PluginMonitoringFilter.init(PluginMonitoringFilter.java:45)

              at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.init(HudsonMonitoringFilter.java:61)

              at hudson.util.PluginServletFilter.addFilter(PluginServletFilter.java:111)

              at org.jvnet.hudson.plugins.monitoring.PluginImpl.start(PluginImpl.java:118)

              at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:534)

              at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:523)

      Caused: java.io.IOException: Failed to initialize

              at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:526)

              at hudson.PluginManager.dynamicLoad(PluginManager.java:865)

      Caused: java.io.IOException: Failed to install monitoring plugin

              at hudson.PluginManager.dynamicLoad(PluginManager.java:874)

              at hudson.PluginManager.dynamicLoad(PluginManager.java:813)

              at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1889)

      Caused: java.io.IOException: Failed to dynamically deploy this plugin

              at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1893)

              at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1651)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

              at java.util.concurrent.FutureTask.run(FutureTask.java:266)

              at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)

              at java.lang.Thread.run(Thread.java:748)

       

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: evernat
          Path:
          pom.xml
          http://jenkins-ci.org/commit/monitoring-plugin/f311a2e2be8005e815769127943bd8c932326856
          Log:
          fix JENKINS-46966: monitoring-plugin installation fails because of old log4j-over-slf4j.jar

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: evernat Path: pom.xml http://jenkins-ci.org/commit/monitoring-plugin/f311a2e2be8005e815769127943bd8c932326856 Log: fix JENKINS-46966 : monitoring-plugin installation fails because of old log4j-over-slf4j.jar
          Hide
          evernat evernat added a comment -

          The plugin does not include the log4-over-slf4j dependency, so it can't be upgraded.

          But I have removed the included slf4j-api dependency (it was included a long time ago only for IBM J9, and not needed anymore because slf4j-api is included in Jenkins now).

          I suppose that it will be better for you.

          This is released as 1.69.1 and should be available in your update center in about 12 or 24h.

          Show
          evernat evernat added a comment - The plugin does not include the log4-over-slf4j dependency, so it can't be upgraded. But I have removed the included slf4j-api dependency (it was included a long time ago only for IBM J9, and not needed anymore because slf4j-api is included in Jenkins now). I suppose that it will be better for you. This is released as 1.69.1 and should be available in your update center in about 12 or 24h.
          Hide
          manuelmink manuel mink added a comment - - edited

          Thank you very much for the quick help.

          But does it make sense to ship a newer log4-over-slf4.jar anyway to solve other possible problems?

          Show
          manuelmink manuel mink added a comment - - edited Thank you very much for the quick help. But does it make sense to ship a newer log4-over-slf4.jar anyway to solve other possible problems?
          Hide
          evernat evernat added a comment -

          log4-over-slf4j never was included in the plugin (only slf4j-api was included), so there is not much sense to add log4-over-slf4j now.

          But anyway, I think that I was a bit too fast above by saying that 1.69.1 would be better for you. And you were right, the problem comes for a part from the quite old log4j-over-slf4j-1.7.7.jar in jenkins.war. (It seems that the other part causing the issue is that you have a log4j.jar somewhere in your classpath, which causes javamelody to add a log4j listener, which fails because of the old log4j-over-slf4j-1.7.7.jar in jenkins.war. Said simply, the log4j.jar in your classpath conflicts with log4j-over-slf4j-1.7.7.jar in jenkins.war).

          Aside from finding this log4j jar file, your chance is that log4j-over-slf4j was upgraded from 1.7.7 to 1.7.25 in jenkins as part of JENKINS-41631 and that should fix your conflict:

          https://github.com/jenkinsci/jenkins/commit/b8f6246d7600a6e7d8b732da9c3153fb33f5ddde#diff-600376dffeb79835ede4a0b285078036R90

          This log4-over-slf4j upgrade was released as jenkins 2.74 in weekly releases, so you can upgrade. (This is not yet in a jenkins LTS release).

          Show
          evernat evernat added a comment - log4-over-slf4j never was included in the plugin (only slf4j-api was included), so there is not much sense to add log4-over-slf4j now. But anyway, I think that I was a bit too fast above by saying that 1.69.1 would be better for you. And you were right, the problem comes for a part from the quite old log4j-over-slf4j-1.7.7.jar in jenkins.war. (It seems that the other part causing the issue is that you have a log4j.jar somewhere in your classpath, which causes javamelody to add a log4j listener, which fails because of the old log4j-over-slf4j-1.7.7.jar in jenkins.war. Said simply, the log4j.jar in your classpath conflicts with log4j-over-slf4j-1.7.7.jar in jenkins.war). Aside from finding this log4j jar file, your chance is that log4j-over-slf4j was upgraded from 1.7.7 to 1.7.25 in jenkins as part of JENKINS-41631 and that should fix your conflict: https://github.com/jenkinsci/jenkins/commit/b8f6246d7600a6e7d8b732da9c3153fb33f5ddde#diff-600376dffeb79835ede4a0b285078036R90 This log4-over-slf4j upgrade was released as jenkins 2.74 in weekly releases, so you can upgrade. (This is not yet in a jenkins LTS release).

            People

            • Assignee:
              evernat evernat
              Reporter:
              manuelmink manuel mink
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: