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

JAX-WS ClassNotFoundException javax.xml.ws.WebServiceException

    XMLWordPrintable

Details

    • 2.4.0

    Description

      Running Jenkins 2.181 got an ClassNotFoundException from CoverityPublisher on javax.xml.ws.WebServiceException.

      Attachments

        Activity

          djviking Sverre Moe created issue -
          batmat Baptiste Mathus made changes -
          Field Original Value New Value
          Attachment deprecated.png [ 47792 ]

          djviking FYI this plugin is deprecated since November 2018. Just commenting as a member of the Java 11 team for Jenkins, not maintaining this plugin myself.
          https://wiki.jenkins.io/display/JENKINS/Coverity+Plugin

          Cheers

          batmat Baptiste Mathus added a comment - djviking FYI this plugin is deprecated since November 2018. Just commenting as a member of the Java 11 team for Jenkins, not maintaining this plugin myself. https://wiki.jenkins.io/display/JENKINS/Coverity+Plugin Cheers
          batmat Baptiste Mathus made changes -
          Labels java11-compatibility java11-compatibility triaged
          djviking Sverre Moe added a comment -

          Thanks. I wasn't aware of that. I guess then this is a no issue. Will try the new plugin and see if it is running fine with Java 11.

          djviking Sverre Moe added a comment - Thanks. I wasn't aware of that. I guess then this is a no issue. Will try the new plugin and see if it is running fine with Java 11.
          djviking Sverre Moe added a comment -

          It would seem the new Coverity Plugin has similar shortcomings running on Jenkins with Java 11.

          1) Error injecting constructor, java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceException
          at com.synopsys.integration.jenkins.coverity.extensions.wrap.CoverityEnvironmentWrapper$DescriptorImpl.<init>(CoverityEnvironmen
          tWrapper.java:169)

          djviking Sverre Moe added a comment - It would seem the new Coverity Plugin has similar shortcomings running on Jenkins with Java 11. 1) Error injecting constructor, java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceException at com.synopsys.integration.jenkins.coverity.extensions.wrap.CoverityEnvironmentWrapper$DescriptorImpl.<init>(CoverityEnvironmen tWrapper.java:169)
          djviking Sverre Moe made changes -
          Component/s synopsys-coverity-plugin [ 24024 ]
          djviking Sverre Moe made changes -
          Component/s coverity-plugin [ 16005 ]
          djviking Sverre Moe added a comment -

          I changed the component to synopsys-coverity-plugin.

          djviking Sverre Moe added a comment - I changed the component to synopsys-coverity-plugin.
          rotte Richard Otte added a comment - - edited

          Replying on behalf of Synopsys (as the developer of the Synopsys Coverity plugin),
          Investigating this extensively, it would appear that the root of this exception is a fundamental problem in Jenkins or JAX-WS. Briefly, JAX-WS has a ServiceLoaderUtil class shared among the SAAJ, JAXB, and JAXWS libraries to invoke java's ServiceLoader and get implementation classes, but it only ever invokes ServiceLoader.load(Class spiClass), the method that tries to load the class from the current thread's context ClassLoader.

          When the exception mentioned by Sverre occurs, the thread that is executing the Synopsys Coverity plugin code does not have the dynamic plugin ClassLoader as it's context ClassLoader-- instead it has the Jenkins WAR ClassLoader, which does not contain any of the JAX-WS classes.

          It appears that either:

          • JAX-WS has a bug and should be patched to not rely on the thread context ClassLoader, for example by also checking the spi class's ClassLoader
          • Jenkins has a bug and should be patched ensuring that threads executing plugin code always have a context ClassLoader that is the dynamic plugin ClassLoader

          In either case, does the Jenkins team have any suggestions for how to work around this problem? I admit I'm fairly new to the Jenkins Jira and I'm not quite sure who to tag.

          Edit: As context, my investigation was conducted while providing the missing JAX-WS classes as jar dependencies to the Synopsys Coverity plugin. I can provide a link to the branch on GitHub if further investigation is needed on the Jenkins side of things to see what I see.

          rotte Richard Otte added a comment - - edited Replying on behalf of Synopsys (as the developer of the Synopsys Coverity plugin), Investigating this extensively, it would appear that the root of this exception is a fundamental problem in Jenkins or JAX-WS. Briefly, JAX-WS has a ServiceLoaderUtil class shared among the SAAJ, JAXB, and JAXWS libraries to invoke java's ServiceLoader and get implementation classes, but it only ever invokes ServiceLoader.load(Class spiClass), the method that tries to load the class from the current thread's context ClassLoader. When the exception mentioned by Sverre occurs, the thread that is executing the Synopsys Coverity plugin code does not have the dynamic plugin ClassLoader as it's context ClassLoader-- instead it has the Jenkins WAR ClassLoader, which does not contain any of the JAX-WS classes. It appears that either: JAX-WS has a bug and should be patched to not rely on the thread context ClassLoader, for example by also checking the spi class's ClassLoader Jenkins has a bug and should be patched ensuring that threads executing plugin code always have a context ClassLoader that is the dynamic plugin ClassLoader In either case, does the Jenkins team have any suggestions for how to work around this problem? I admit I'm fairly new to the Jenkins Jira and I'm not quite sure who to tag. Edit: As context, my investigation was conducted while providing the missing JAX-WS classes as jar dependencies to the Synopsys Coverity plugin. I can provide a link to the branch on GitHub if further investigation is needed on the Jenkins side of things to see what I see.
          basil Basil Crow added a comment -

          Hi rotte, this is actually a common problem in Jenkins plugins. See this section of the developer documentation. The solution is to wrap your calls to JAX-WS in a try/finally that temporarily overrides the context class loader. See jenkinsci/jira-plugin#353 for example.

          basil Basil Crow added a comment - Hi rotte , this is actually a common problem in Jenkins plugins. See this section of the developer documentation . The solution is to wrap your calls to JAX-WS in a try/finally that temporarily overrides the context class loader. See jenkinsci/jira-plugin#353 for example.
          basil Basil Crow added a comment -

          Actually looks like this was already done in jenkinsci/synopsys-coverity-plugin#8, so perhaps this bug should be marked as resolved in 2.4.0?

          basil Basil Crow added a comment - Actually looks like this was already done in jenkinsci/synopsys-coverity-plugin#8 , so perhaps this bug should be marked as resolved in 2.4.0?
          basil Basil Crow added a comment - Fixed in jenkinsci/synopsys-coverity-plugin#8 .
          basil Basil Crow made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
          basil Basil Crow added a comment -

          Released in 2.4.0.

          basil Basil Crow added a comment - Released in 2.4.0 .
          basil Basil Crow made changes -
          Released As 2.4.0
          Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

          People

            synopsys_sig_jenkins Synopsys SIG
            djviking Sverre Moe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: