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

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

    Details

    • Similar Issues:

      Description

      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
      

        Attachments

          Issue Links

            Activity

            nachevn Nikolay Nachev created issue -
            nachevn Nikolay Nachev made changes -
            Field Original Value New Value
            Description If I try to read an xml file within a pipeline with XmlSluper:

            {code}
            String versionPrefix = this.adaptVersionPrefix(releasePrefix)
            String nexusUrl = "${env.NEXUS_BASE_URL}/service/local/repositories/${repository}/content/${group.replaceAll('\\.','/') + '/' + artifact}/maven-metadata.xml"
            URL metadataUrl = new URL(nexusUrl)
            URLConnection connection = metadataUrl.openConnection()
            if (connection.responseCode == 404) {
            // returned all the first time
            return versionPrefix + '1'
            } else if (connection.responseCode == 200) {
            String xmlContent = connection.content.text
            def metadata = new XmlSlurper().parseText(xmlContent)
            List<Integer> maxVersion = []
            for (GPathResult pathResult : metadata.'versioning'.'versions'.'version') {
            if (pathResult.toString().startsWith(versionPrefix)) {
            maxVersion << Integer.valueOf(pathResult.text() - versionPrefix)
            }
            }
            if (maxVersion.isEmpty()) {
            // only one by new release
            return versionPrefix + '1'
            } else {
            return versionPrefix + (maxVersion.sort().last() + 1);
            }
            } else {
            throw new Exception("Unknown response code (${connection.responseCode}) from nexus url ${nexusUrl}. Exit job...")
            }
            {code}

            an error is thrown:

            {code}
            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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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 Script1.getArtifactBuildVersion(Script1.groovy:129)
            at WorkflowScript.run(WorkflowScript:34)
            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.GeneratedMethodAccessor373.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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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)
            {code}

            The error line 131 looks like:
            {code}
            def metadata = new XmlSlurper().parseText(xmlContent)
            {code}
            If I try to read an xml file within a pipeline with XmlSluper:

            {code}
            String versionPrefix = this.adaptVersionPrefix(releasePrefix)
            String nexusUrl = "${env.NEXUS_BASE_URL}/service/local/repositories/${repository}/content/${group.replaceAll('\\.','/') + '/' + artifact}/maven-metadata.xml"
            URL metadataUrl = new URL(nexusUrl)
            URLConnection connection = metadataUrl.openConnection()
            if (connection.responseCode == 404) {
            // returned all the first time
            return versionPrefix + '1'
            } else if (connection.responseCode == 200) {
            String xmlContent = connection.content.text
            def metadata = new XmlSlurper().parseText(xmlContent)
            List<Integer> maxVersion = []
            for (GPathResult pathResult : metadata.'versioning'.'versions'.'version') {
            if (pathResult.toString().startsWith(versionPrefix)) {
            maxVersion << Integer.valueOf(pathResult.text() - versionPrefix)
            }
            }
            if (maxVersion.isEmpty()) {
            // only one by new release
            return versionPrefix + '1'
            } else {
            return versionPrefix + (maxVersion.sort().last() + 1);
            }
            } else {
            throw new Exception("Unknown response code (${connection.responseCode}) from nexus url ${nexusUrl}. Exit job...")
            }
            {code}

            an error is thrown:

            {code}
            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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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 Script1.getArtifactBuildVersion(Script1.groovy:129)
            at WorkflowScript.run(WorkflowScript:34)
            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.GeneratedMethodAccessor373.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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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)
            {code}

            The error line 131 looks like:
            {code}
            def metadata = new XmlSlurper().parseText(xmlContent)
            {code}

            Even if I try to initialize the XmlSluper class, the same error is thrown
            nachevn Nikolay Nachev made changes -
            Description If I try to read an xml file within a pipeline with XmlSluper:

            {code}
            String versionPrefix = this.adaptVersionPrefix(releasePrefix)
            String nexusUrl = "${env.NEXUS_BASE_URL}/service/local/repositories/${repository}/content/${group.replaceAll('\\.','/') + '/' + artifact}/maven-metadata.xml"
            URL metadataUrl = new URL(nexusUrl)
            URLConnection connection = metadataUrl.openConnection()
            if (connection.responseCode == 404) {
            // returned all the first time
            return versionPrefix + '1'
            } else if (connection.responseCode == 200) {
            String xmlContent = connection.content.text
            def metadata = new XmlSlurper().parseText(xmlContent)
            List<Integer> maxVersion = []
            for (GPathResult pathResult : metadata.'versioning'.'versions'.'version') {
            if (pathResult.toString().startsWith(versionPrefix)) {
            maxVersion << Integer.valueOf(pathResult.text() - versionPrefix)
            }
            }
            if (maxVersion.isEmpty()) {
            // only one by new release
            return versionPrefix + '1'
            } else {
            return versionPrefix + (maxVersion.sort().last() + 1);
            }
            } else {
            throw new Exception("Unknown response code (${connection.responseCode}) from nexus url ${nexusUrl}. Exit job...")
            }
            {code}

            an error is thrown:

            {code}
            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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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 Script1.getArtifactBuildVersion(Script1.groovy:129)
            at WorkflowScript.run(WorkflowScript:34)
            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.GeneratedMethodAccessor373.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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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)
            {code}

            The error line 131 looks like:
            {code}
            def metadata = new XmlSlurper().parseText(xmlContent)
            {code}

            Even if I try to initialize the XmlSluper class, the same error is thrown
            If I try to read an xml file within a pipeline with XmlSluper:

            {code}
            String versionPrefix = this.adaptVersionPrefix(releasePrefix)
            String nexusUrl = "${env.NEXUS_BASE_URL}/service/local/repositories/${repository}/content/${group.replaceAll('\\.','/') + '/' + artifact}/maven-metadata.xml"
            URL metadataUrl = new URL(nexusUrl)
            URLConnection connection = metadataUrl.openConnection()
            if (connection.responseCode == 404) {
            // returned all the first time
            return versionPrefix + '1'
            } else if (connection.responseCode == 200) {
            String xmlContent = connection.content.text
            def metadata = new XmlSlurper().parseText(xmlContent)
            List<Integer> maxVersion = []
            for (GPathResult pathResult : metadata.'versioning'.'versions'.'version') {
            if (pathResult.toString().startsWith(versionPrefix)) {
            maxVersion << Integer.valueOf(pathResult.text() - versionPrefix)
            }
            }
            if (maxVersion.isEmpty()) {
            // only one by new release
            return versionPrefix + '1'
            } else {
            return versionPrefix + (maxVersion.sort().last() + 1);
            }
            } else {
            throw new Exception("Unknown response code (${connection.responseCode}) from nexus url ${nexusUrl}. Exit job...")
            }
            {code}

            an error is thrown:

            {code}
            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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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 Script1.getArtifactBuildVersion(Script1.groovy:129)
            at WorkflowScript.run(WorkflowScript:34)
            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.GeneratedMethodAccessor373.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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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)
            {code}

            The error line 131 looks like:
            {code}
            def metadata = new XmlSlurper().parseText(xmlContent)
            {code}

            Even if I try only to initialize the XmlSluper class, the same error is thrown
            Hide
            nachevn Nikolay Nachev added a comment - - edited

            After long investigation of the problem, I've found finally the cause of the error. It is the JaCoCo Plugin. If the plugin is installed and activated the error occurs.

            Show
            nachevn Nikolay Nachev added a comment - - edited After long investigation of the problem, I've found finally the cause of the error. It is the JaCoCo Plugin . If the plugin is installed and activated the error occurs.
            nachevn Nikolay Nachev made changes -
            Component/s jacoco-plugin [ 16541 ]
            nachevn Nikolay Nachev made changes -
            Description If I try to read an xml file within a pipeline with XmlSluper:

            {code}
            String versionPrefix = this.adaptVersionPrefix(releasePrefix)
            String nexusUrl = "${env.NEXUS_BASE_URL}/service/local/repositories/${repository}/content/${group.replaceAll('\\.','/') + '/' + artifact}/maven-metadata.xml"
            URL metadataUrl = new URL(nexusUrl)
            URLConnection connection = metadataUrl.openConnection()
            if (connection.responseCode == 404) {
            // returned all the first time
            return versionPrefix + '1'
            } else if (connection.responseCode == 200) {
            String xmlContent = connection.content.text
            def metadata = new XmlSlurper().parseText(xmlContent)
            List<Integer> maxVersion = []
            for (GPathResult pathResult : metadata.'versioning'.'versions'.'version') {
            if (pathResult.toString().startsWith(versionPrefix)) {
            maxVersion << Integer.valueOf(pathResult.text() - versionPrefix)
            }
            }
            if (maxVersion.isEmpty()) {
            // only one by new release
            return versionPrefix + '1'
            } else {
            return versionPrefix + (maxVersion.sort().last() + 1);
            }
            } else {
            throw new Exception("Unknown response code (${connection.responseCode}) from nexus url ${nexusUrl}. Exit job...")
            }
            {code}

            an error is thrown:

            {code}
            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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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 Script1.getArtifactBuildVersion(Script1.groovy:129)
            at WorkflowScript.run(WorkflowScript:34)
            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.GeneratedMethodAccessor373.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.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            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)
            {code}

            The error line 131 looks like:
            {code}
            def metadata = new XmlSlurper().parseText(xmlContent)
            {code}

            Even if I try only to initialize the XmlSluper class, the same error is thrown
            If I try to read an xml file within a pipeline with XmlSluper:

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

            an error is thrown:

            {code}
            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
            {code}
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-37538 [ JENKINS-37538 ]
            Hide
            jglick Jesse Glick added a comment -

            jacoco.hpi includes WEB-INF/lib/xercesImpl-2.9.1.jar and WEB-INF/lib/xml-apis-1.0.b2.jar, which is unnecessary and harmful. Please set up <excludes> in your POM and review bundled JARs—there are far too many and most are likely unused.

            Show
            jglick Jesse Glick added a comment - jacoco.hpi includes WEB-INF/lib/xercesImpl-2.9.1.jar and WEB-INF/lib/xml-apis-1.0.b2.jar , which is unnecessary and harmful. Please set up <excludes> in your POM and review bundled JARs—there are far too many and most are likely unused.
            jglick Jesse Glick made changes -
            Component/s pipeline [ 21692 ]
            Labels pipeline
            Assignee Ognjen Bubalo [ ognjenb ]
            Hide
            jglick Jesse Glick added a comment -

            That said, be advised that use of XmlSlurper and similar utilities from Pipeline script is not supported. Perform any such processing outside of Jenkins, in sh/bat steps.

            Show
            jglick Jesse Glick added a comment - That said, be advised that use of XmlSlurper and similar utilities from Pipeline script is not supported . Perform any such processing outside of Jenkins, in sh / bat steps.
            Hide
            pgeorgiev Pavel Georgiev added a comment - - edited

            This issue seems to be the cause of this one (gitab plugin:

             

            https://github.com/jenkinsci/gitlab-plugin/issues/430

            Show
            pgeorgiev Pavel Georgiev added a comment - - edited This issue seems to be the cause of this one (gitab plugin:   https://github.com/jenkinsci/gitlab-plugin/issues/430
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Dominik Stadler
            Path:
            pom.xml
            http://jenkins-ci.org/commit/jacoco-plugin/4baa40f8fb07cda1159880769e0f92024183d152
            Log:
            JENKINS-41515:

            • Update Jenkins parent to 1.625.3 to be able to test with current pipeline-plugin
            • Adjust dependencies and add some exclusions to remove a number of unnecessary jars from the resulting hpi file
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dominik Stadler Path: pom.xml http://jenkins-ci.org/commit/jacoco-plugin/4baa40f8fb07cda1159880769e0f92024183d152 Log: JENKINS-41515 : Update Jenkins parent to 1.625.3 to be able to test with current pipeline-plugin Adjust dependencies and add some exclusions to remove a number of unnecessary jars from the resulting hpi file
            Hide
            centic centic added a comment -

            Fixed on master by adding some excludes in the pom, this will become available with version 2.2.1 and newer.

            Show
            centic centic added a comment - Fixed on master by adding some excludes in the pom, this will become available with version 2.2.1 and newer.
            centic centic made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            cleclerc Cyrille Le Clerc made changes -
            Link This issue is related to JENKINS-43512 [ JENKINS-43512 ]
            Hide
            gabitchov Gabriel PASCUAL added a comment -

            Hi,

            Does someone have an idea when the next release was planned ?

            Regards,

            Gabriel

            Show
            gabitchov Gabriel PASCUAL added a comment - Hi, Does someone have an idea when the next release was planned ? Regards, Gabriel
            Hide
            centic centic added a comment -

            tagged just now, I had some trouble pushing to the maven-repo, but seems to be uploaded nevertheless, should be available soon, please ping me if it does not become available for you.

            Show
            centic centic added a comment - tagged just now, I had some trouble pushing to the maven-repo, but seems to be uploaded nevertheless, should be available soon, please ping me if it does not become available for you.
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-1932 (Web Link)" [ 18507 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-1911 (Web Link)" [ 18515 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: