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

Cannot create nestedView with job-dsl 1.49

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins 2.18
      job-dsl 1.49
      nested-view 1.14

      This all worked fine earlier today when I had 1.48. Once I upgraded to 1.49 I started getting this error:

      11:40:52 com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.plugins.nested__view.NestedView
      11:40:52 	at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:282)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:43)
      11:40:52 	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      11:40:52 	at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:48)
      11:40:52 	at javaposse.jobdsl.plugin.JenkinsJobManagement.checkItemType(JenkinsJobManagement.java:526)
      11:40:52 	at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateView(JenkinsJobManagement.java:172)
      11:40:52 	at javaposse.jobdsl.dsl.JobManagement$createOrUpdateView$7.call(Unknown Source)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
      11:40:52 	at javaposse.jobdsl.plugin.InterruptibleJobManagement.createOrUpdateView(InterruptibleJobManagement.groovy:43)
      11:40:52 	at javaposse.jobdsl.dsl.JobManagement$createOrUpdateView$7.call(Unknown Source)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader$_extractGeneratedViews_closure5.doCall(DslScriptLoader.groovy:224)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      11:40:52 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      11:40:52 	at java.lang.reflect.Method.invoke(Method.java:497)
      11:40:52 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      11:40:52 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      11:40:52 	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      11:40:52 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      11:40:52 	at groovy.lang.Closure.call(Closure.java:414)
      11:40:52 	at groovy.lang.Closure.call(Closure.java:430)
      11:40:52 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
      11:40:52 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
      11:40:52 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068)
      11:40:52 	at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader.extractGeneratedViews(DslScriptLoader.groovy:221)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader.this$2$extractGeneratedViews(DslScriptLoader.groovy)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      11:40:52 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      11:40:52 	at java.lang.reflect.Method.invoke(Method.java:497)
      11:40:52 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      11:40:52 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      11:40:52 	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
      11:40:52 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader$_runScriptsWithClassLoader_closure1.doCall(DslScriptLoader.groovy:87)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      11:40:52 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      11:40:52 	at java.lang.reflect.Method.invoke(Method.java:497)
      11:40:52 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      11:40:52 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      11:40:52 	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      11:40:52 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      11:40:52 	at groovy.lang.Closure.call(Closure.java:414)
      11:40:52 	at groovy.lang.Closure.call(Closure.java:430)
      11:40:52 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
      11:40:52 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
      11:40:52 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068)
      11:40:52 	at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader(DslScriptLoader.groovy:68)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader.this$2$runScriptsWithClassLoader(DslScriptLoader.groovy)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:40:52 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      11:40:52 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      11:40:52 	at java.lang.reflect.Method.invoke(Method.java:497)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
      11:40:52 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
      11:40:52 	at javaposse.jobdsl.dsl.DslScriptLoader.runScripts(DslScriptLoader.groovy:44)
      11:40:52 	at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:327)
      11:40:52 	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
      11:40:52 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      11:40:52 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      11:40:52 	at hudson.model.Build$BuildExecution.build(Build.java:205)
      11:40:52 	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      11:40:52 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      11:40:52 	at hudson.model.Run.execute(Run.java:1720)
      11:40:52 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      11:40:52 	at hudson.model.ResourceController.execute(ResourceController.java:98)
      11:40:52 	at hudson.model.Executor.run(Executor.java:404)
      11:40:52 ERROR: hudson.plugins.nested__view.NestedView
      

      The jobdsl code in question is pretty boring:

      nestedView('0_Factories') {
          views {
              listView('Factories') {
                  jobs {
                      regex('^Factory-.*')
                  }
                  columns {
                      status()
                      weather()
                      name()
                      lastSuccess()
                      lastFailure()
                      lastDuration()
                      buildButton()
                  }
              }
              listView('Something else') {
                  description('''\
                      Some other stuff goes here
                  '''.stripIndent())
                  jobs {
                      name("foo")
                      name("bar")
                  }
                  columns {
                      status()
                      weather()
                      name()
                      lastSuccess()
                      lastFailure()
                      lastDuration()
                      buildButton()
                  }
              }
          }
          configure {
              it << defaultView('Factories')
          }
      }
      

      When I downgraded to 1.48, it all works again.

            daspilker Daniel Spilker
            b_dean Ben Dean
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: