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

Job DSL fails to add new job

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: job-dsl-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.25, job-dsl-plugin 1.51
    • Similar Issues:

      Description

      I have DSL script that creates new job for every banch read from separate text file.
      Sometimes this job which processes DSL script fails to create new job defined in DSL.
      Job log indicates that new job creation succeeded:

      Existing items:
          ...
          GeneratedJob{name='GameON_feature-click_on_logo_opens_menu_android'}
          ...
      

      But it doesn't show in jenkins ui and job files are not created on disk.
      In jenkins log I found this error:

      INFO: createOrUpdateConfig for GameON_feature-click_on_logo_opens_menu_android
      Oct 11, 2016 10:25:17 AM javaposse.jobdsl.plugin.JenkinsJobManagement createNewItem
      WARNING: Error writing config for new item GameON_feature-click_on_logo_opens_menu_android.
      java.io.IOException: Failed to persist config.xml
      	at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:297)
      	at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:3749)
      	at javaposse.jobdsl.plugin.JenkinsJobManagement.createNewItem(JenkinsJobManagement.java:533)
      	at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateConfig(JenkinsJobManagement.java:148)
      	at javaposse.jobdsl.dsl.JobManagement$createOrUpdateConfig$5.call(Unknown Source)
      	at javaposse.jobdsl.plugin.InterruptibleJobManagement.createOrUpdateConfig(InterruptibleJobManagement.groovy:37)
      	at javaposse.jobdsl.dsl.JobManagement$createOrUpdateConfig$5.call(Unknown Source)
      	at javaposse.jobdsl.dsl.DslScriptLoader$_extractGeneratedJobs_closure4.doCall(DslScriptLoader.groovy:212)
      	at sun.reflect.GeneratedMethodAccessor2351.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      	at groovy.lang.Closure.call(Closure.java:414)
      	at groovy.lang.Closure.call(Closure.java:430)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
      	at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      	at javaposse.jobdsl.dsl.DslScriptLoader.extractGeneratedJobs(DslScriptLoader.groovy:203)
      	at javaposse.jobdsl.dsl.DslScriptLoader.this$2$extractGeneratedJobs(DslScriptLoader.groovy)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
      	at javaposse.jobdsl.dsl.DslScriptLoader$_runScriptsWithClassLoader_closure1.doCall(DslScriptLoader.groovy:84)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      	at groovy.lang.Closure.call(Closure.java:414)
      	at groovy.lang.Closure.call(Closure.java:430)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068)
      	at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      	at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader(DslScriptLoader.groovy:68)
      	at javaposse.jobdsl.dsl.DslScriptLoader.this$2$runScriptsWithClassLoader(DslScriptLoader.groovy)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
      	at javaposse.jobdsl.dsl.DslScriptLoader.runScripts(DslScriptLoader.groovy:44)
      	at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:327)
      	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.Build$BuildExecution.build(Build.java:205)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      	at hudson.model.Run.execute(Run.java:1720)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:401)
      Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
      java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
      	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
      	at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
      	at jenkins.util.xml.XMLUtils.safeTransform(XMLUtils.java:66)
      	at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:274)
      	... 74 more
      Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450)
      	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
      	at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
      	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
      	... 77 more
      
      

      Restarting jenkins and running main DSL job again fixes this problem.

      DSL:

      def branches = []
      readFileFromWorkspace("branches.txt").eachLine { branches << it }
      
      branches.each {
          def branchName = it.replaceAll('\'', '')
          def jobName = "GameON_${branchName.substring(7)}_android".replaceAll('/', '-')
          job(jobName) {
              displayName("GameON ${branchName}")
              ...
          }
          if (!jenkins.model.Jenkins.instance.getItemByFullName(jobName)) {
              queue(jobName)
          }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            daspilker Daniel Spilker added a comment -

            There are several related issues, see https://issues.jenkins-ci.org/issues/?jql=project%20%3D%20JENKINS%20AND%20text%20~%20%22Failed%20to%20persist%20config.xml%22.

            Unfortunaletly the IOException is not very helpful since it's not the root of the problem. But it's cause should have been logged right below starting with Caused by:. Can you provide the complete exception including all "Caused by" exceptions?

            Show
            daspilker Daniel Spilker added a comment - There are several related issues, see https://issues.jenkins-ci.org/issues/?jql=project%20%3D%20JENKINS%20AND%20text%20~%20%22Failed%20to%20persist%20config.xml%22 . Unfortunaletly the IOException is not very helpful since it's not the root of the problem. But it's cause should have been logged right below starting with Caused by: . Can you provide the complete exception including all "Caused by" exceptions?
            Hide
            andbtk Andrius Butkevicius added a comment -
            INFO: createOrUpdateConfig for GameON_feature-click_on_logo_opens_menu_android
            Oct 11, 2016 10:25:17 AM javaposse.jobdsl.plugin.JenkinsJobManagement createNewItem
            WARNING: Error writing config for new item GameON_feature-click_on_logo_opens_menu_android.
            java.io.IOException: Failed to persist config.xml
            	at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:297)
            	at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:3749)
            	at javaposse.jobdsl.plugin.JenkinsJobManagement.createNewItem(JenkinsJobManagement.java:533)
            	at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateConfig(JenkinsJobManagement.java:148)
            	at javaposse.jobdsl.dsl.JobManagement$createOrUpdateConfig$5.call(Unknown Source)
            	at javaposse.jobdsl.plugin.InterruptibleJobManagement.createOrUpdateConfig(InterruptibleJobManagement.groovy:37)
            	at javaposse.jobdsl.dsl.JobManagement$createOrUpdateConfig$5.call(Unknown Source)
            	at javaposse.jobdsl.dsl.DslScriptLoader$_extractGeneratedJobs_closure4.doCall(DslScriptLoader.groovy:212)
            	at sun.reflect.GeneratedMethodAccessor2351.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
            	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
            	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            	at groovy.lang.Closure.call(Closure.java:414)
            	at groovy.lang.Closure.call(Closure.java:430)
            	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
            	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
            	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
            	at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
            	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
            	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
            	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
            	at javaposse.jobdsl.dsl.DslScriptLoader.extractGeneratedJobs(DslScriptLoader.groovy:203)
            	at javaposse.jobdsl.dsl.DslScriptLoader.this$2$extractGeneratedJobs(DslScriptLoader.groovy)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
            	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
            	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
            	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
            	at javaposse.jobdsl.dsl.DslScriptLoader$_runScriptsWithClassLoader_closure1.doCall(DslScriptLoader.groovy:84)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
            	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
            	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            	at groovy.lang.Closure.call(Closure.java:414)
            	at groovy.lang.Closure.call(Closure.java:430)
            	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
            	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
            	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068)
            	at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source)
            	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
            	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
            	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
            	at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader(DslScriptLoader.groovy:68)
            	at javaposse.jobdsl.dsl.DslScriptLoader.this$2$runScriptsWithClassLoader(DslScriptLoader.groovy)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
            	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
            	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
            	at javaposse.jobdsl.dsl.DslScriptLoader.runScripts(DslScriptLoader.groovy:44)
            	at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:327)
            	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
            	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
            	at hudson.model.Build$BuildExecution.build(Build.java:205)
            	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
            	at hudson.model.Run.execute(Run.java:1720)
            	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            	at hudson.model.ResourceController.execute(ResourceController.java:98)
            	at hudson.model.Executor.run(Executor.java:401)
            Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
            java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
            	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
            	at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
            	at jenkins.util.xml.XMLUtils.safeTransform(XMLUtils.java:66)
            	at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:274)
            	... 74 more
            Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
            	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450)
            	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
            	at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
            	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
            	... 77 more
            
            
            Show
            andbtk Andrius Butkevicius added a comment - INFO: createOrUpdateConfig for GameON_feature-click_on_logo_opens_menu_android Oct 11, 2016 10:25:17 AM javaposse.jobdsl.plugin.JenkinsJobManagement createNewItem WARNING: Error writing config for new item GameON_feature-click_on_logo_opens_menu_android. java.io.IOException: Failed to persist config.xml at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:297) at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:3749) at javaposse.jobdsl.plugin.JenkinsJobManagement.createNewItem(JenkinsJobManagement.java:533) at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateConfig(JenkinsJobManagement.java:148) at javaposse.jobdsl.dsl.JobManagement$createOrUpdateConfig$5.call(Unknown Source) at javaposse.jobdsl.plugin.InterruptibleJobManagement.createOrUpdateConfig(InterruptibleJobManagement.groovy:37) at javaposse.jobdsl.dsl.JobManagement$createOrUpdateConfig$5.call(Unknown Source) at javaposse.jobdsl.dsl.DslScriptLoader$_extractGeneratedJobs_closure4.doCall(DslScriptLoader.groovy:212) at sun.reflect.GeneratedMethodAccessor2351.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at groovy.lang.Closure.call(Closure.java:414) at groovy.lang.Closure.call(Closure.java:430) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056) at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at javaposse.jobdsl.dsl.DslScriptLoader.extractGeneratedJobs(DslScriptLoader.groovy:203) at javaposse.jobdsl.dsl.DslScriptLoader. this $2$extractGeneratedJobs(DslScriptLoader.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) at javaposse.jobdsl.dsl.DslScriptLoader$_runScriptsWithClassLoader_closure1.doCall(DslScriptLoader.groovy:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at groovy.lang.Closure.call(Closure.java:414) at groovy.lang.Closure.call(Closure.java:430) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068) at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader(DslScriptLoader.groovy:68) at javaposse.jobdsl.dsl.DslScriptLoader. this $2$runScriptsWithClassLoader(DslScriptLoader.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182) at javaposse.jobdsl.dsl.DslScriptLoader.runScripts(DslScriptLoader.groovy:44) at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:327) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1720) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:401) Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230) at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191) at jenkins.util.xml.XMLUtils.safeTransform(XMLUtils.java:66) at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:274) ... 74 more Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang. ClassLoader .loadClass( ClassLoader .java:424) at java.lang. ClassLoader .loadClass( ClassLoader .java:357) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403) at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82) at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228) ... 77 more
            Hide
            andbtk Andrius Butkevicius added a comment -

            Plugins:

            # grep -ir 'org.xml.sax.driver' *
            Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
            Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches
            Binary file jacoco/WEB-INF/lib/xercesImpl-2.9.1.jar matches
            Binary file jdepend/WEB-INF/lib/xercesImpl-2.8.1.jar matches
            Binary file jshint-checkstyle/WEB-INF/lib/xercesImpl-2.8.1.jar matches
            Binary file jslint-checkstyle/WEB-INF/lib/xercesImpl-2.8.1.jar matches
            
            Show
            andbtk Andrius Butkevicius added a comment - Plugins: # grep -ir 'org.xml.sax.driver' * Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches Binary file jacoco/WEB-INF/lib/xercesImpl-2.9.1.jar matches Binary file jdepend/WEB-INF/lib/xercesImpl-2.8.1.jar matches Binary file jshint-checkstyle/WEB-INF/lib/xercesImpl-2.8.1.jar matches Binary file jslint-checkstyle/WEB-INF/lib/xercesImpl-2.8.1.jar matches
            Hide
            andbtk Andrius Butkevicius added a comment -

            How to solve this problem?

            Show
            andbtk Andrius Butkevicius added a comment - How to solve this problem?
            Hide
            daspilker Daniel Spilker added a comment -

            Ask in JENKINS-27548. Maybe you need to update the plugins mentioned in that ticket.

            Show
            daspilker Daniel Spilker added a comment - Ask in JENKINS-27548 . Maybe you need to update the plugins mentioned in that ticket.
            Hide
            iyad Iyad Al added a comment -

            Andrius Butkevicius Do you use a folder element in your Job DSL? I use the same Jenkins and Job DSL version and get the same error. When I remove whitespaces in folder it works

            Throws exception: java.io.IOException: Failed to persist config.xml

            folder("with whitespace")
            

            Works fine

            folder("without_whitespace")
            

            Daniel Spilker The XMLUtils.safeTransform()-method seems to have problems with whitespaces. It would be great, if you can fix it. I can't rename all folders with underscore

            Show
            iyad Iyad Al added a comment - Andrius Butkevicius Do you use a folder element in your Job DSL? I use the same Jenkins and Job DSL version and get the same error. When I remove whitespaces in folder it works Throws exception: java.io.IOException: Failed to persist config.xml folder( "with whitespace" ) Works fine folder( "without_whitespace" ) Daniel Spilker The XMLUtils.safeTransform()-method seems to have problems with whitespaces. It would be great, if you can fix it. I can't rename all folders with underscore
            Hide
            daspilker Daniel Spilker added a comment -
            Show
            daspilker Daniel Spilker added a comment - Iyad Al See JENKINS-35638

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                andbtk Andrius Butkevicius
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: