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

Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not a subtype

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • jacoco-plugin
    • Jenkins 2.19.1, 2.32.1

      If I try to read an xml file within a pipeline with XmlSluper:

      def rootNode = new XmlSlurper().parseText(
                  '''<root>
                       <a>one!</a>
                       <a>two!</a>
                     </root>''' )
              
      assert rootNode.a.size() == 2
      

      an error is thrown:

      javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
      	at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:311)
      	at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
      	at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127)
      	at groovy.xml.FactorySupport$2.run(FactorySupport.java:58)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at groovy.xml.FactorySupport.createFactory(FactorySupport.java:35)
      	at groovy.xml.FactorySupport.createSaxParserFactory(FactorySupport.java:56)
      	at groovy.util.XmlSlurper.<init>(XmlSlurper.java:128)
      	at groovy.util.XmlSlurper.<init>(XmlSlurper.java:114)
      	at groovy.util.XmlSlurper.<init>(XmlSlurper.java:101)
      	at sun.reflect.GeneratedConstructorAccessor408.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
      	at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:194)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onNewInstance(GroovyInterceptor.java:40)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:128)
      	at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:191)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:188)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:20)
      	at WorkflowScript.run(WorkflowScript:33)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:96)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
      	at sun.reflect.GeneratedMethodAccessor518.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.RuntimeException: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
      	at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:308)
      	at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
      	at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127)
      	at groovy.xml.FactorySupport$2.run(FactorySupport.java:58)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at groovy.xml.FactorySupport.createFactory(FactorySupport.java:35)
      	at groovy.xml.FactorySupport.createSaxParserFactory(FactorySupport.java:56)
      	at groovy.util.XmlSlurper.<init>(XmlSlurper.java:128)
      	at groovy.util.XmlSlurper.<init>(XmlSlurper.java:114)
      	at groovy.util.XmlSlurper.<init>(XmlSlurper.java:101)
      	at sun.reflect.GeneratedConstructorAccessor408.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
      	at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:194)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onNewInstance(GroovyInterceptor.java:40)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:128)
      	at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:191)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:188)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:20)
      	... 28 more
      Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.SAXParserFactory: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not a subtype
      	at java.util.ServiceLoader.fail(ServiceLoader.java:239)
      	at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
      	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
      	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
      	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
      	at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:294)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
      	... 50 more
      

            ognjenb Ognjen Bubalo
            nachevn Nikolay Nachev
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: