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

exception when running seed job on test server

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gradle-jpi-plugin
    • None

      1. run "./gradlew server" with the latest master
      2. create a seed job with a simple script: job

      { name 'test' }

      3. run the job
      4. get the following error

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      Could not instantiate global transform class groovy.grape.GrabAnnotationTransformation specified at jar:file:/Users/sheehan/dev/project/job-dsl-plugin/work/war/WEB-INF/lib/groovy-all-1.8.9.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception java.lang.ClassNotFoundException: groovy.grape.GrabAnnotationTransformation

      1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
      at org.codehaus.groovy.control.ProcessingUnit.completePhase(ProcessingUnit.java:143)
      at org.codehaus.groovy.control.ProcessingUnit.gotoPhase(ProcessingUnit.java:162)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:493)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
      at groovy.util.GroovyScriptEngine$ScriptClassLoader.doParseClass(GroovyScriptEngine.java:258)
      at groovy.util.GroovyScriptEngine$ScriptClassLoader.parseClass(GroovyScriptEngine.java:240)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:214)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:224)
      at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:58)
      at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:91)
      at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:199)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585)
      at hudson.model.Run.execute(Run.java:1684)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)

          [JENKINS-26377] exception when running seed job on test server

          Matt Sheehan added a comment -

          works if i revert to 1.28

          Matt Sheehan added a comment - works if i revert to 1.28

          This issue popped up while updating to Jenkins core 1.554, see https://github.com/jenkinsci/job-dsl-plugin/pull/327#issuecomment-68607175

          The root of problem is that the Job DSL plugin brings it's own Groovy library and configures the Jenkins plugin class loader to load the plugin's library before the core libraries and to hide the groovy.grapes package from the core libraries. That's a very uncommon behavior and causes further problems like the one reported here.

          I had to add a workaround to fix the issue when building the JPI/HPI file, as mentioned here. But that workaround is not picked up by the server task.

          Instead of adding more workarounds be should avoid the complex class loader configuration and use the Groovy library provided by Jenkins core. But that would break support for the @Grab annotation. That's why Stefan started a discussion on the mailing list to remove the support for @Grab: https://groups.google.com/forum/?fromgroups#!topic/job-dsl-plugin/EG6eqQYYI7M.

          Daniel Spilker added a comment - This issue popped up while updating to Jenkins core 1.554, see https://github.com/jenkinsci/job-dsl-plugin/pull/327#issuecomment-68607175 The root of problem is that the Job DSL plugin brings it's own Groovy library and configures the Jenkins plugin class loader to load the plugin's library before the core libraries and to hide the groovy.grapes package from the core libraries. That's a very uncommon behavior and causes further problems like the one reported here. I had to add a workaround to fix the issue when building the JPI/HPI file, as mentioned here . But that workaround is not picked up by the server task. Instead of adding more workarounds be should avoid the complex class loader configuration and use the Groovy library provided by Jenkins core. But that would break support for the @Grab annotation. That's why Stefan started a discussion on the mailing list to remove the support for @Grab: https://groups.google.com/forum/?fromgroups#!topic/job-dsl-plugin/EG6eqQYYI7M .

          I changed the component to gradle-jpi-plugin since the issue is going to be fixed there: https://github.com/jenkinsci/gradle-jpi-plugin/pull/43

          Daniel Spilker added a comment - I changed the component to gradle-jpi-plugin since the issue is going to be fixed there: https://github.com/jenkinsci/gradle-jpi-plugin/pull/43

          Will be released in gradle-jpi-plugin 0.9.1.

          Daniel Spilker added a comment - Will be released in gradle-jpi-plugin 0.9.1.

          Code changed in jenkins
          User: Stefan Wolf
          Path:
          src/main/groovy/org/jenkinsci/gradle/plugins/jpi/JpiHplManifest.groovy
          http://jenkins-ci.org/commit/gradle-jpi-plugin/6a44e85589990be23e4912c33ea3d444743a0dcd
          Log:
          [FIXED JENKINS-26377] Use classpath from JPI-Task instead of runtimeClasspath

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stefan Wolf Path: src/main/groovy/org/jenkinsci/gradle/plugins/jpi/JpiHplManifest.groovy http://jenkins-ci.org/commit/gradle-jpi-plugin/6a44e85589990be23e4912c33ea3d444743a0dcd Log: [FIXED JENKINS-26377] Use classpath from JPI-Task instead of runtimeClasspath

          I'll update the job-dsl-plugin soon.

          Daniel Spilker added a comment - I'll update the job-dsl-plugin soon.

            daspilker Daniel Spilker
            mattsheehan Matt Sheehan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: