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

FactoryConfigurationError when parsing XML on IBM J9 JVM master and Oracle JVM slave

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • violations-plugin
    • Jenkins version: 1.499
      Violations plugin version: 0.7.11
      Master: IBM J9 VM 2.4 (JRE 1.6.0) (Linux: SLES 11 SP2)
      Slave: Oracle JVM 1.7.0_11 (Windows 2008 Server R2)

      Our Jenkins master executes an MSBuild job on a Windows slave, and the Violations plugin is throwing an exception when parsing FxCop's XML results.

      The plugin can parse the XML successfully when the job isn't being executed on a slave. (Tested using a "faux project path" on the master's local file system)

      Full stack trace from build console log:

      ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception
      hudson.util.IOException2: remote file operation failed: c:\jenkins\workspace\TestBuild at hudson.remoting.Channel@36c136c1:wpg-lt-24-cs9t1
      at hudson.FilePath.act(FilePath.java:848)
      at hudson.FilePath.act(FilePath.java:825)
      at hudson.plugins.violations.ViolationsPublisher.perform(ViolationsPublisher.java:74)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
      at hudson.model.Run.execute(Run.java:1568)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
      Caused by: java.io.IOException: Remote call on wpg-lt-24-cs9t1 failed
      at hudson.remoting.Channel.call(Channel.java:681)
      at hudson.FilePath.act(FilePath.java:841)
      ... 11 more
      Caused by: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
      at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
      at hudson.plugins.violations.types.fxcop.FxCopParser.parse(FxCopParser.java:41)
      at hudson.plugins.violations.ViolationsCollector.doType(ViolationsCollector.java:187)
      at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:114)
      at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:25)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2309)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:58)
      at java.lang.Thread.run(Unknown Source)

          [JENKINS-16493] FactoryConfigurationError when parsing XML on IBM J9 JVM master and Oracle JVM slave

          Oleg Nenashev added a comment -

          Seems to be JVM-specific

          Oleg Nenashev added a comment - Seems to be JVM-specific

          Martin Kutter added a comment - - edited

          The cause of this error is probably the different packaging of Xerces in Oracle and IBM JDK.

          Oracle JDK packages the class in question as com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactory, while in the IBM J9 JDK it is packaged as org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.
          It looks like the violations plugin on the slave looks for the DocumentBuilderFactoryImpl configured on the master (which is not there) - probably because the DocumentBuilderFactory is serialized on the master and sent to the client for execution (the default impl class is hardcoded in DocumentBuilderFactory).

          This means this is a general problem (and not IBM J9 specific) - any master with a alternate DocumentBuilderFactoryImpl configured (as compared to Oracle JDK) will cause this error.

          The DocumentBuilderFactory javadoc http://docs.oracle.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilderFactory.html states how the impl class is resolved - does setting the system property javax.xml.parsers.DocumentBuilderFactory, e.g.

          -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactory

          on the slave help?

          Martin Kutter added a comment - - edited The cause of this error is probably the different packaging of Xerces in Oracle and IBM JDK. Oracle JDK packages the class in question as com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactory , while in the IBM J9 JDK it is packaged as org.apache.xerces.jaxp.DocumentBuilderFactoryImpl . It looks like the violations plugin on the slave looks for the DocumentBuilderFactoryImpl configured on the master (which is not there) - probably because the DocumentBuilderFactory is serialized on the master and sent to the client for execution (the default impl class is hardcoded in DocumentBuilderFactory ). This means this is a general problem (and not IBM J9 specific) - any master with a alternate DocumentBuilderFactoryImpl configured (as compared to Oracle JDK) will cause this error. The DocumentBuilderFactory javadoc http://docs.oracle.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilderFactory.html states how the impl class is resolved - does setting the system property javax.xml.parsers.DocumentBuilderFactory , e.g. -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactory on the slave help?

          Mark Waite added a comment -

          We've removed OpenJ9 from the Jenkins Docker images so that we can focus our platform portability efforts on Java 11 with the hotspot VM on amd64, arm64, ppc64le, and s390x. Jenkins 2.307 controller images (debian and ubi) include multi-platform support.

          Mark Waite added a comment - We've removed OpenJ9 from the Jenkins Docker images so that we can focus our platform portability efforts on Java 11 with the hotspot VM on amd64, arm64, ppc64le, and s390x. Jenkins 2.307 controller images (debian and ubi) include multi-platform support.

            peterkittreilly peterkittreilly
            brant Brant Bobby
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: