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

Classloader isolation of m2 build on tomcat. (JDK 1.5 m2 build on Tomcat 6 (JDK 1.6) on Ubuntu 8.10)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • core
    • None
    • Platform: PC, OS: Linux

      I was attempting to run hudson inside a copy of Tomcat 6 using JDK 1.6 on Ubuntu
      8.10 and run a Maven 2 build with JDK 1.5. As soon as hudson tried to archive
      the first pom encountered it blows up with the stack trace:

      [INFO] Trace
      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.findClass(RemoteClassLoader.java:96)
      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.FilePath.act(FilePath.java:434)
      at hudson.FilePath.copyTo(FilePath.java:869)
      at hudson.FilePath.copyTo(FilePath.java:857)
      at hudson.maven.reporters.MavenArtifact.archive(MavenArtifact.java:184)
      at
      hudson.maven.reporters.MavenArtifactArchiver.postBuild(MavenArtifactArchiver.java:107)
      at
      hudson.maven.MavenModuleSetBuild$Builder.postModule(MavenModuleSetBuild.java:612)
      at hudson.maven.MavenBuilder$Adapter.fireLeaveModule(MavenBuilder.java:307)
      at hudson.maven.MavenBuilder$Adapter.postBuild(MavenBuilder.java:265)
      at
      org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:68)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
      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:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at hudson.maven.agent.Main.launch(Main.java:158)
      at hudson.maven.MavenBuilder.call(MavenBuilder.java:162)
      at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:579)
      at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:525)
      at hudson.remoting.UserRequest.perform(UserRequest.java:92)
      at hudson.remoting.UserRequest.perform(UserRequest.java:46)
      at hudson.remoting.Request$2.run(Request.java:236)
      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:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)

      The reason is that on Ubuntu 8.10 they compile Tomcat 6 on JDK 1.6 so all the
      tomcat classfiles have a version requirement of 50 (JDK 1.6).

      It seems that the classloader of the servlet container is used during the maven
      build which causes this issue. I wouldn't have expected the build to have access
      to any classes of the container that is was running in.

            Unassigned Unassigned
            buckett Matthew Buckett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: