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

Periodic LinkageError / NoClassDefFoundError reported from javamelody monitoring plugin

    • Icon: Story Story
    • Resolution: Fixed
    • Icon: Minor Minor
    • monitoring-plugin
    • None
    • Jenkins LTS 2.289.3 with Monitoring 1.88.0 plugin, running on Jetty 10.0.6, JDK11 on both master and nodes.

      With the versions listed above, I am seeing this exception logged every 3-30 seconds in the node logfile:

       

      Oct 11, 2021 2:14:58 PM hudson.remoting.UserRequest perform
      WARNING: LinkageError while performing UserRequest:net.bull.javamelody.RemoteCallHelper$DelegatingTask@a8df2b3
      java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jetty.jndi.InitialContextFactory
      	at java.base/java.lang.Class.forName0(Native Method)
      	at java.base/java.lang.Class.forName(Class.java:398)
      	at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:127)
      	at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:133)
      	at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:100)
      	at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:757)
      	at java.naming/javax.naming.spi.NamingManager.lambda$getInitialContext$1(NamingManager.java:722)
      	at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
      	at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
      	at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:722)
      	at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
      	at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
      	at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:184)
      	at net.bull.javamelody.JdbcWrapperHelper.getJndiDataSourcesAt(JdbcWrapperHelper.java:189)
      	at net.bull.javamelody.JdbcWrapperHelper.getJndiDataSources(JdbcWrapperHelper.java:165)
      	at net.bull.javamelody.JdbcWrapperHelper.getJndiAndSpringDataSources(JdbcWrapperHelper.java:153)
      	at net.bull.javamelody.JdbcWrapper.getJndiAndSpringDataSources(JdbcWrapper.java:385)
      	at net.bull.javamelody.internal.model.JavaInformations.buildDataBaseVersion(JavaInformations.java:419)
      	at net.bull.javamelody.internal.model.JavaInformations.<init>(JavaInformations.java:200)
      	at net.bull.javamelody.RemoteCallHelper$JavaInformationsTask.call(RemoteCallHelper.java:107)
      	at net.bull.javamelody.RemoteCallHelper$JavaInformationsTask.call(RemoteCallHelper.java:94)
      	at net.bull.javamelody.RemoteCallHelper$DelegatingTask.call(RemoteCallHelper.java:166)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      	at hudson.remoting.Request$2.run(Request.java:376)
      	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:119)
      	at java.base/java.lang.Thread.run(Thread.java:834)

      Any thoughts on how to resolve? 

          [JENKINS-66855] Periodic LinkageError / NoClassDefFoundError reported from javamelody monitoring plugin

          Steve Roth added a comment -

          Note I am specifying an agent workdir, in case that makes a difference.

          Steve Roth added a comment - Note I am specifying an agent workdir, in case that makes a difference.

          Evgeny Evseev added a comment -

          the style tag is included in the page header
          with a lot of urls that are not related to monitoring. it is not very clear how they are generated in such a way-as I did not find it when looking at the source code. is it possible to remove this from the title?

          <style type="text/css" class="">
          <style type="text/css" class="">
          :root a[href^="https://www.handy-sextreffen.info/?c="],
          ...
          :root a[href^="https://dpm.jungekontakte.com/click.php?dp="],
          ...
          </style>
          </style>

           

          is it possible to use external css?

          Evgeny Evseev added a comment - the style tag is included in the page header with a lot of urls that are not related to monitoring. it is not very clear how they are generated in such a way-as I did not find it when looking at the source code. is it possible to remove this from the title? <style type="text/css" class=""> <style type="text/css" class=""> :root a [href^="https://www.handy-sextreffen.info/?c="] , ... :root a [href^="https://dpm.jungekontakte.com/click.php?dp="] , ... </style> </style>   is it possible to use external css?

          evernat added a comment -

          ev2evgeny Please do not hijack this ticket and create another ticket.
          And of course, these do not come from the monitoring plugin. I suggest to try with another computer to check if it depends on your own computer.

          evernat added a comment - ev2evgeny Please do not hijack this ticket and create another ticket. And of course, these do not come from the monitoring plugin. I suggest to try with another computer to check if it depends on your own computer.

          evernat added a comment - - edited

          srothco I do not reproduce the issue with the agent, both when using the embedded winstone/jetty and when using an external jetty 10 server, with JDK 11.
          Is there something special in your setup, except the agent work dir? an unusual JVM perhaps.
          And a workaround should be to add a system property like -Djavamelody.no-database=true when launching the nodes.
          Does the workaround fix the issue for you?
          An answer for the 2 questions in this issue would be great so that a fix may be included in the plugin.

          evernat added a comment - - edited srothco I do not reproduce the issue with the agent, both when using the embedded winstone/jetty and when using an external jetty 10 server, with JDK 11. Is there something special in your setup, except the agent work dir? an unusual JVM perhaps. And a workaround should be to add a system property like -Djavamelody.no-database=true when launching the nodes. Does the workaround fix the issue for you? An answer for the 2 questions in this issue would be great so that a fix may be included in the plugin.

          Steve Roth added a comment -

          We are using JDK11 –

          java version "11.0.12" 2021-07-20 LTS
          Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237)
          Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)

          We are using a custom docker image using Remoting 4.7.

          Thanks – I will try the workaround and post back shortly.

          Steve Roth added a comment - We are using JDK11 – java version "11.0.12" 2021-07-20 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode) We are using a custom docker image using Remoting 4.7. Thanks – I will try the workaround and post back shortly.

          Steve Roth added a comment -

          I can confirm that adding JAVA_OPTS="-Djavamelody.no-database=true" resolves this issue on our agents.
          Thank-you!

          Steve Roth added a comment - I can confirm that adding JAVA_OPTS="-Djavamelody.no-database=true" resolves this issue on our agents. Thank-you!

          evernat added a comment -

          evernat added a comment - fixed by https://github.com/jenkinsci/monitoring-plugin/commit/b6478d7484db5a3f4268b9623deda8c9c803e1d5

            evernat evernat
            srothco Steve Roth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: