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

Maven cannot run with JDK1.5 anymore

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: maven-plugin
    • Labels:
      None
    • Similar Issues:
      Show 5 results

      Description

      Since an update to jenkins 1.395 the maven projects running with an JDK 1.5 arent working anymore.

      The error "Bad version number in .class file" looks like something got compiled with a newer java version. This error happens on a slave with maven 2.0.11 and oracle-jdk 1.5.21.

      • When i reconfigure the project to oracle-jdk 1.6.20 it works.
      • It also works with java 1.5 when executed directly on den shell.
        -> The only thing different there is the magic agent stuff.

      So i extracted the jars : maven-interceptor, maven-agent, slave.jar, classworlds. Non of which there seems to be a newer .class version number. Any ideas which files could cause the problem? Pretty sure this is a jenkins issue, otherwise maven wouldn't compile it directly on the build system.

      LOG:

      At revision 56650
      no change for http://.../trunk since the previous build
      Found mavenVersion 2.0.11 from file jar:file:/srv/hudson/tools/maven-2.0.x/lib/maven-2.0.11-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
      No emails were triggered.
      Parsing POMs
      [maven-versioninfo-plugin] $ /srv/hudson/tools/Java-1.5.x/bin/java -Xmx512m -Xms64m -XX:PermSize=64m -XX:MaxPermSize=128m -cp /srv/hudson/maven-agent.jar:/srv/hudson/classworlds.jar hudson.maven.agent.Main /srv/hudson/tools/maven-2.0.x /srv/hudson/slave.jar /srv/hudson/maven-interceptor.jar 44373
      <===[HUDSON REMOTING CAPACITY]===>���channel started
      channel stopped
      ERROR: POMs konnten nicht geparst werden
      java.io.IOException: Remote call on Channel to Maven [/srv/hudson/tools/Java-1.5.x/bin/java, -Xmx512m, -Xms64m, -XX:PermSize=64m, -XX:MaxPermSize=128m, -cp, /srv/hudson/maven-agent.jar:/srv/hudson/classworlds.jar, hudson.maven.agent.Main, /srv/hudson/tools/maven-2.0.x, /srv/hudson/slave.jar, /srv/hudson/maven-interceptor.jar, 44373] failed
      	at hudson.remoting.Channel.call(Channel.java:638)
      	at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:665)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
      	at hudson.model.Run.run(Run.java:1362)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:424)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:145)
      Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
      	at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:151)
      	at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:131)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      	at hudson.plugins.cobertura.MavenCoberturaPublisher.<clinit>(MavenCoberturaPublisher.java:237)
      	at sun.misc.Unsafe.ensureClassInitialized(Native Method)
      	at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
      	at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
      	at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
      	at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
      	at java.lang.reflect.Field.getLong(Field.java:528)
      	at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1586)
      	at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
      	at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:400)
      	at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297)
      	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531)
      	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
      	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
      	at java.util.ArrayList.readObject(ArrayList.java:591)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:592)
      	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
      	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1812)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
      	at java.util.HashMap.readObject(HashMap.java:1067)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:592)
      	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
      	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1812)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
      	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1910)
      	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1834)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
      	at hudson.remoting.UserRequest.deserialize(UserRequest.java:178)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:98)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:270)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
      	at java.lang.Thread.run(Thread.java:595)
      

        Attachments

          Activity

          Hide
          brunojcm Bruno Medeiros added a comment -

          Same error here, on Jenkins 1.463:

          <===[JENKINS REMOTING CAPACITY]===>channel started
          log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
          log4j:WARN Please initialize the log4j system properly.
          channel stopped
          ERROR: Failed to parse POMs
          java.io.IOException: Remote call on Channel to Maven [/var/lib/jenkins/tools/Sun_JDK_1.5/bin/java, -cp, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.2.jar:/var/lib/jenkins/tools/Maven_2/boot/classworlds-1.1.jar, hudson.maven.agent.Main, /var/lib/jenkins/tools/Maven_2, /var/cache/jenkins/war/WEB-INF/lib/remoting-2.13.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.2.jar, 59378, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven2.1-interceptor-1.2.jar] failed
          	at hudson.remoting.Channel.call(Channel.java:655)
          	at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156)
          	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:791)
          	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
          	at hudson.model.Run.run(Run.java:1434)
          	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
          	at hudson.model.ResourceController.execute(ResourceController.java:88)
          	at hudson.model.Executor.run(Executor.java:239)
          Caused by: java.lang.ClassFormatError: Failed to load com.google.common.collect.ImmutableSet
          	at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:154)
          	at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:131)
          	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
          	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
          	at hudson.security.PermissionScope.<init>(PermissionScope.java:70)
          	at hudson.security.PermissionScope.<clinit>(PermissionScope.java:95)
          	at hudson.security.Permission.<init>(Permission.java:179)
          	at hudson.security.Permission.<clinit>(Permission.java:292)
          	at hudson.model.Run.<clinit>(Run.java:2038)
          	at hudson.maven.Maven2Builder.call(Maven2Builder.java:74)
          	at hudson.maven.Maven2Builder.call(Maven2Builder.java:53)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          	at hudson.remoting.Request$2.run(Request.java:287)
          	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
          	at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
          	at java.lang.ClassLoader.defineClass1(Native Method)
          	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
          	at java.lang.ClassLoader.defineClass(ClassLoader.java:466)
          	at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:152)
          	... 20 more
          Finished: FAILURE
          </pre>
          
          Show
          brunojcm Bruno Medeiros added a comment - Same error here, on Jenkins 1.463: <===[JENKINS REMOTING CAPACITY]===>channel started log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter). log4j:WARN Please initialize the log4j system properly. channel stopped ERROR: Failed to parse POMs java.io.IOException: Remote call on Channel to Maven [/ var /lib/jenkins/tools/Sun_JDK_1.5/bin/java, -cp, / var /lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.2.jar:/ var /lib/jenkins/tools/Maven_2/boot/classworlds-1.1.jar, hudson.maven.agent.Main, / var /lib/jenkins/tools/Maven_2, / var /cache/jenkins/war/WEB-INF/lib/remoting-2.13.jar, / var /lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.2.jar, 59378, / var /lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven2.1-interceptor-1.2.jar] failed at hudson.remoting.Channel.call(Channel.java:655) at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156) at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:791) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) at hudson.model.Run.run(Run.java:1434) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) Caused by: java.lang.ClassFormatError: Failed to load com.google.common.collect.ImmutableSet at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:154) at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:131) at java.lang. ClassLoader .loadClass( ClassLoader .java:307) at java.lang. ClassLoader .loadClass( ClassLoader .java:252) at java.lang. ClassLoader .loadClassInternal( ClassLoader .java:320) at hudson.security.PermissionScope.<init>(PermissionScope.java:70) at hudson.security.PermissionScope.<clinit>(PermissionScope.java:95) at hudson.security.Permission.<init>(Permission.java:179) at hudson.security.Permission.<clinit>(Permission.java:292) at hudson.model.Run.<clinit>(Run.java:2038) at hudson.maven.Maven2Builder.call(Maven2Builder.java:74) at hudson.maven.Maven2Builder.call(Maven2Builder.java:53) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang. Thread .run( Thread .java:595) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang. ClassLoader .defineClass1(Native Method) at java.lang. ClassLoader .defineClass( ClassLoader .java:621) at java.lang. ClassLoader .defineClass( ClassLoader .java:466) at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:152) ... 20 more Finished: FAILURE </pre>
          Hide
          sogabe sogabe added a comment -

          @Bruno Updating to 1.464 will help you. See JENKINS-13659

          Show
          sogabe sogabe added a comment - @Bruno Updating to 1.464 will help you. See JENKINS-13659
          Hide
          brunojcm Bruno Medeiros added a comment -

          @sogabe Thanks, it's ok for me now! It seems that my post is unrelated to this bug, right?

          Show
          brunojcm Bruno Medeiros added a comment - @sogabe Thanks, it's ok for me now! It seems that my post is unrelated to this bug, right?
          Hide
          sogabe sogabe added a comment -

          @Bruno Maybe

          Show
          sogabe sogabe added a comment - @Bruno Maybe
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          I'm marking this as fixed as a duplicate of JENKINS-13659.

          My earlier fix to remoting would provide critical information needed to fix recurrence of similar bugs. If people continue to see this problem, please upgrade to 1.463 or later and then report the stack trace, which will contain the offending class name.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - I'm marking this as fixed as a duplicate of JENKINS-13659 . My earlier fix to remoting would provide critical information needed to fix recurrence of similar bugs. If people continue to see this problem, please upgrade to 1.463 or later and then report the stack trace, which will contain the offending class name.

            People

            • Assignee:
              kohsuke Kohsuke Kawaguchi
              Reporter:
              rainerw Rainer Weinhold
            • Votes:
              7 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: