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

StAX can't be used inside a plugin using Java 1.5

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • plugin-proposals
    • None
    • Platform: All, OS: All

      Attempts to call XMLInputFactory.newInstance() inside a plugin fail with this
      exception:

      Caused by: javax.xml.stream.FactoryConfigurationError: Provider
      com.bea.xml.stream.MXParserFactory not found

      I believe this is because jsr173-1.0.jar is included in the Hudson war, but no
      implementation is provided. This is a transitive dependency via dom4j.

      Proposed solutions (in order of my personal preference):
      1) Include a StAX implementation in the Hudson war.
      2) Remove jsr173-1.0.jar from the Hudson war.
      3) Change the plugin classloader model so that plugin jars take precedence over
      Hudson-provided jars.

      Under Java 6 this is not a problem.

        1. staxtest.zip
          0.9 kB
        2. staxtest.zip
          0.9 kB

          [JENKINS-2547] StAX can't be used inside a plugin using Java 1.5

          justinedelson added a comment -

          Created an attachment (id=418)
          simple testcase

          justinedelson added a comment - Created an attachment (id=418) simple testcase

          justinedelson added a comment -

          with the attached zip testcase, just ensure that JAVA_HOME is set to a 1.5 jdk
          and then run:
          mvn hpi:run

          justinedelson added a comment - with the attached zip testcase, just ensure that JAVA_HOME is set to a 1.5 jdk and then run: mvn hpi:run

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/pom.xml
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=12965
          Log:
          [FIXED JENKINS-2547] bundled Woodstox starting 1.259.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/pom.xml trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=12965 Log: [FIXED JENKINS-2547] bundled Woodstox starting 1.259.

          justinedelson added a comment -

          There's still a problem, but it's the reverse of what was happening before.

          Before the API classes were in the Hudson classpath, but there wasn't an
          implementation. Now there's an implementation, but no API classes.

          stax:stax-api is being excluded in the war's pom.xml.

          As I mentioned in the original description, jsr173-1.0.jar was in the WAR
          previously, but now it's not. Getting that back would solve this problem.

          justinedelson added a comment - There's still a problem, but it's the reverse of what was happening before. Before the API classes were in the Hudson classpath, but there wasn't an implementation. Now there's an implementation, but no API classes. stax:stax-api is being excluded in the war's pom.xml. As I mentioned in the original description, jsr173-1.0.jar was in the WAR previously, but now it's not. Getting that back would solve this problem.

          justinedelson added a comment -

          Created an attachment (id=429)
          updated testcase post 1.259

          justinedelson added a comment - Created an attachment (id=429) updated testcase post 1.259

          justinedelson added a comment -

          Just to be clear, the error now is:
          java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamReader

          justinedelson added a comment - Just to be clear, the error now is: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamReader

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/war/pom.xml
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=13645
          Log:
          [FIXED JENKINS-2547] Added stax API. Sorry for the delay. In 1.265.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/war/pom.xml trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=13645 Log: [FIXED JENKINS-2547] Added stax API. Sorry for the delay. In 1.265.

            Unassigned Unassigned
            justinedelson justinedelson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: