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

plugin failures after upgrade of bytecode-compatability-transformer

      After the fix of JENKINS-28781 the acceptance test harness for the batch-task-plugin fails with

      java.lang.RuntimeException: java.lang.ClassNotFoundException: org.jenkinsci.lib.envinject.service.EnvVarsResolver
       at org.kohsuke.asm5.ClassWriter.getCommonSuperClass(ClassWriter.java:1684)
       at org.kohsuke.asm5.ClassWriter.getMergedType(ClassWriter.java:1654)
       at org.kohsuke.asm5.Frame.merge(Frame.java:1426)
       at org.kohsuke.asm5.Frame.merge(Frame.java:1325)
       at org.kohsuke.asm5.MethodWriter.visitMaxs(MethodWriter.java:1475)
       at org.kohsuke.asm5.tree.MethodNode.accept(MethodNode.java:833)
       at org.kohsuke.asm5.commons.JSRInlinerAdapter.visitEnd(JSRInlinerAdapter.java:187)
       at org.kohsuke.asm5.MethodVisitor.visitEnd(MethodVisitor.java:877)
       at org.kohsuke.asm5.ClassReader.readMethod(ClassReader.java:1021)
      

          [JENKINS-30820] plugin failures after upgrade of bytecode-compatability-transformer

          James Nord created issue -
          James Nord made changes -
          Assignee Original: Kohsuke Kawaguchi [ kohsuke ] New: James Nord [ teilo ]
          James Nord made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          James Nord made changes -
          Link New: This issue is related to JENKINS-28781 [ JENKINS-28781 ]
          James Nord made changes -
          Link New: This issue is related to JENKINS-28799 [ JENKINS-28799 ]
          James Nord made changes -
          Description Original: After the fix of JENKINS-28781 the acceptance test harness for the batch-task-plung fails with

          {noformat}
          java.lang.RuntimeException: java.lang.ClassNotFoundException: org.jenkinsci.lib.envinject.service.EnvVarsResolver
           at org.kohsuke.asm5.ClassWriter.getCommonSuperClass(ClassWriter.java:1684)
           at org.kohsuke.asm5.ClassWriter.getMergedType(ClassWriter.java:1654)
           at org.kohsuke.asm5.Frame.merge(Frame.java:1426)
           at org.kohsuke.asm5.Frame.merge(Frame.java:1325)
           at org.kohsuke.asm5.MethodWriter.visitMaxs(MethodWriter.java:1475)
           at org.kohsuke.asm5.tree.MethodNode.accept(MethodNode.java:833)
           at org.kohsuke.asm5.commons.JSRInlinerAdapter.visitEnd(JSRInlinerAdapter.java:187)
           at org.kohsuke.asm5.MethodVisitor.visitEnd(MethodVisitor.java:877)
           at org.kohsuke.asm5.ClassReader.readMethod(ClassReader.java:1021)
          {noformat}
          New: After the fix of JENKINS-28781 the acceptance test harness for the batch-task-plugin fails with

          {noformat}
          java.lang.RuntimeException: java.lang.ClassNotFoundException: org.jenkinsci.lib.envinject.service.EnvVarsResolver
           at org.kohsuke.asm5.ClassWriter.getCommonSuperClass(ClassWriter.java:1684)
           at org.kohsuke.asm5.ClassWriter.getMergedType(ClassWriter.java:1654)
           at org.kohsuke.asm5.Frame.merge(Frame.java:1426)
           at org.kohsuke.asm5.Frame.merge(Frame.java:1325)
           at org.kohsuke.asm5.MethodWriter.visitMaxs(MethodWriter.java:1475)
           at org.kohsuke.asm5.tree.MethodNode.accept(MethodNode.java:833)
           at org.kohsuke.asm5.commons.JSRInlinerAdapter.visitEnd(JSRInlinerAdapter.java:187)
           at org.kohsuke.asm5.MethodVisitor.visitEnd(MethodVisitor.java:877)
           at org.kohsuke.asm5.ClassReader.readMethod(ClassReader.java:1021)
          {noformat}

          James Nord added a comment -

          just running the code with mvn hpi:run on the latest snapshot does not show this issue.

          However it does throw the following exception when trying to build a task.

          Oct 09, 2015 1:35:26 PM hudson.model.Executor finish1
          SEVERE: Executor threw an exception
          java.lang.NoClassDefFoundError: hudson/matrix/MatrixRun
                  at org.jenkinsci.lib.envinject.service.EnvInjectActionRetriever.getEnvInjectAction(EnvInjectActionRetriever.java:25)
                  at org.jenkinsci.lib.envinject.service.EnvVarsResolver.getEnVars(EnvVarsResolver.java:54)
                  at hudson.plugins.batch_task.BatchRun.run(BatchRun.java:224)
                  at hudson.model.ResourceController.execute(ResourceController.java:98)
                  at hudson.model.Executor.run(Executor.java:408)
          Caused by: java.lang.ClassNotFoundException: hudson.matrix.MatrixRun
                  at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
                  at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
                  at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
                  ... 5 more
          

          James Nord added a comment - just running the code with mvn hpi:run on the latest snapshot does not show this issue. However it does throw the following exception when trying to build a task. Oct 09, 2015 1:35:26 PM hudson.model.Executor finish1 SEVERE: Executor threw an exception java.lang.NoClassDefFoundError: hudson/matrix/MatrixRun at org.jenkinsci.lib.envinject.service.EnvInjectActionRetriever.getEnvInjectAction(EnvInjectActionRetriever.java:25) at org.jenkinsci.lib.envinject.service.EnvVarsResolver.getEnVars(EnvVarsResolver.java:54) at hudson.plugins.batch_task.BatchRun.run(BatchRun.java:224) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408) Caused by: java.lang.ClassNotFoundException: hudson.matrix.MatrixRun at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376) at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326) at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 5 more

          James Nord added a comment -

          so the root cause is that to generate stackFrames and for some parts of this the common ancestor of 2 classes is required. These classes may not yet have been loaded or in the classloader (and indeed could be the class being transformed).

          ASM loads these classes using Class.forName() using the classloader of the ASM classes

          In order to resolve this we would need to provide our own ClassWriter implementation which would be able to load all the classes in Jenkins (and potentially the un-altered classes to prevent any circular re-writing from happening).

          James Nord added a comment - so the root cause is that to generate stackFrames and for some parts of this the common ancestor of 2 classes is required. These classes may not yet have been loaded or in the classloader (and indeed could be the class being transformed). ASM loads these classes using Class.forName() using the classloader of the ASM classes In order to resolve this we would need to provide our own ClassWriter implementation which would be able to load all the classes in Jenkins (and potentially the un-altered classes to prevent any circular re-writing from happening).
          James Nord made changes -
          Link New: This issue duplicates JENKINS-30912 [ JENKINS-30912 ]
          James Nord made changes -
          Component/s New: ssh-plugin [ 16049 ]

            Unassigned Unassigned
            teilo James Nord
            Votes:
            40 Vote for this issue
            Watchers:
            52 Start watching this issue

              Created:
              Updated:
              Resolved: