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

processMavenSpyLogs can fail with "java.lang.IllegalAccessError: tried to access method"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: pipeline-maven-plugin
    • Labels:
      None
    • Environment:
      Jenkins Core 2.107.x
      Maven-pipeline 3.5.6
    • Similar Issues:

      Description

      Issue:
      When running a maven process inside of a build an error popped up saying

      java.lang.IllegalAccessError: tried to access method org.apache.xerces.parsers.XML11Configuration.getFeature0(Ljava/lang/String;)Z from class org.apache.xerces.parsers.XIncludeAwareParserConfiguration 
      at org.apache.xerces.parsers.XIncludeAwareParserConfiguration.getFeature(Unknown Source) 
      at org.apache.xerces.parsers.AbstractDOMParser.reset(Unknown Source) 
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) 
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) 
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) 
      at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) 
      at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:97) 
      at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WithMavenStepExecutionCallBack.finished(WithMavenStepExecution.java:1050) 
      

      It seems to come from the code here:
      https://github.com/jenkinsci/pipeline-maven-plugin/blob/1729e64250c10213ca428141092540bdeeaba97a/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenSpyLogProcessor.java#L97

      Steps to reproduce:
      I have not been able to narrow down why it is unable to load a library so it happened with one job but not with others.

      Workaround:
      Disable the spy event entirely with `JENKINS_MAVEN_AGENT_DISABLED = true `

        Attachments

          Issue Links

            Activity

            Hide
            cleclerc Cyrille Le Clerc added a comment -

            Ulli Hafner thanks, if you could by any chance cut a version of the "old findbugs plugin", it would help the transition to the new world.

            Show
            cleclerc Cyrille Le Clerc added a comment - Ulli Hafner thanks, if you could by any chance cut a version of the "old findbugs plugin", it would help the transition to the new world.
            Hide
            drulli Ulli Hafner added a comment -

            I released findbugs-5.0.0-beta3 now, that contains the findbugs library with Xerces 2.11.0.

            Note: It would still be quite helpful to find the actual plugin (or tool?) that sets the sax property globally! I added some logging to the warnings plugin now to see if the sax property has been altered.

            Show
            drulli Ulli Hafner added a comment - I released findbugs-5.0.0-beta3 now, that contains the findbugs library with Xerces 2.11.0. Note: It would still be quite helpful to find the actual plugin (or tool?) that sets the sax property globally! I added some logging to the warnings plugin now to see if the sax property has been altered.
            Hide
            cleclerc Cyrille Le Clerc added a comment -

            > I released findbugs-5.0.0-beta3 now, that contains the findbugs library with Xerces 2.11.0.

            Thanks Ulli Hafner!

            > Note: It would still be quite helpful to find the actual plugin (or tool?) that sets the sax property globally! I added some logging to the warnings plugin now to see if the sax property has been altered.

            I am not aware of such problem. Is it the reason why you import Xerces in the findbugs plugin?

            Show
            cleclerc Cyrille Le Clerc added a comment - > I released findbugs-5.0.0-beta3 now, that contains the findbugs library with Xerces 2.11.0. Thanks Ulli Hafner ! > Note: It would still be quite helpful to find the actual plugin (or tool?) that sets the sax property globally! I added some logging to the warnings plugin now to see if the sax property has been altered. I am not aware of such problem. Is it the reason why you import Xerces in the findbugs plugin?
            Hide
            drulli Ulli Hafner added a comment -

            Yes, this is the only reason. FindBugs uses XMLReaderFactory to obtain a parser. Normally this is the JDK parser. However, someone (plugin, system configuration, container, etc.?) seems to override one of the SAX settings (system property or Service Locator) and defines Xerces as default.

            Show
            drulli Ulli Hafner added a comment - Yes, this is the only reason. FindBugs uses XMLReaderFactory to obtain a parser. Normally this is the JDK parser. However, someone (plugin, system configuration, container, etc.?) seems to override one of the SAX settings (system property or Service Locator) and defines Xerces as default.
            Hide
            cleclerc Cyrille Le Clerc added a comment -

            Understood. I am sorry but I have no clue of who could do this.

            Show
            cleclerc Cyrille Le Clerc added a comment - Understood. I am sorry but I have no clue of who could do this.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ataylor Alex Taylor
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: