java.lang.UnsupportedClassVersionError: Bad version number in .class file

Jenkins JIRA | Ludovic Meurillon | 5 years ago
  1. 0

    Jenkins fail to start with an Exception due to JDK1.5 incompatibility : 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.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) 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 jenkins.model.Jenkins.<clinit>(Jenkins.java:3817) at hudson.WebAppMain.installLogger(WebAppMain.java:256) at hudson.WebAppMain.contextInitialized(WebAppMain.java:107) at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:875) at winstone.HostConfiguration.initWebApp(HostConfiguration.java:129) at winstone.HostConfiguration.<init>(HostConfiguration.java:71) at winstone.HostGroup.initHost(HostGroup.java:87) at winstone.HostGroup.<init>(HostGroup.java:47) at winstone.Launcher.<init>(Launcher.java:177) at winstone.Launcher.main(Launcher.java:384) 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 Main._main(Main.java:273) at Main.main(Main.java:98) It seems to come from usage of the last Guava release version that doesn't support JDK1.5 (http://code.google.com/p/guava-libraries/wiki/Release12#JDK6_APIs) Change that seems to be reponsible from this error : https://github.com/jenkinsci/jenkins/commit/95c8707511e83af772d29b25d30343d2d58bcbad

    Jenkins JIRA | 5 years ago | Ludovic Meurillon
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  2. 0

    Jenkins fail to start with an Exception due to JDK1.5 incompatibility : 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.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) 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 jenkins.model.Jenkins.<clinit>(Jenkins.java:3817) at hudson.WebAppMain.installLogger(WebAppMain.java:256) at hudson.WebAppMain.contextInitialized(WebAppMain.java:107) at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:875) at winstone.HostConfiguration.initWebApp(HostConfiguration.java:129) at winstone.HostConfiguration.<init>(HostConfiguration.java:71) at winstone.HostGroup.initHost(HostGroup.java:87) at winstone.HostGroup.<init>(HostGroup.java:47) at winstone.Launcher.<init>(Launcher.java:177) at winstone.Launcher.main(Launcher.java:384) 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 Main._main(Main.java:273) at Main.main(Main.java:98) It seems to come from usage of the last Guava release version that doesn't support JDK1.5 (http://code.google.com/p/guava-libraries/wiki/Release12#JDK6_APIs) Change that seems to be reponsible from this error : https://github.com/jenkinsci/jenkins/commit/95c8707511e83af772d29b25d30343d2d58bcbad

    Jenkins JIRA | 5 years ago | Ludovic Meurillon
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    When I try to update a password on "Configure" view for a specific User jenkins return a HTTP 500 with a stackTrace : javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:616) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:488) at org.kohsuke.stapler.Stapler.service(Stapler.java:162) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:248) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:63) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at winstone.RequestDispatcher.forward(RequestDispatcher.java:331) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:215) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:138) 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 winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) 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) 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.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at hudson.security.HudsonPrivateSecurityRealm$3.encodePassword(HudsonPrivateSecurityRealm.java:621) at hudson.security.HudsonPrivateSecurityRealm$4.encodePassword(HudsonPrivateSecurityRealm.java:641) at hudson.security.HudsonPrivateSecurityRealm$Details.fromPlainPassword(HudsonPrivateSecurityRealm.java:441) at hudson.security.HudsonPrivateSecurityRealm$Details$DescriptorImpl.newInstance(HudsonPrivateSecurityRealm.java:525) at hudson.security.HudsonPrivateSecurityRealm$Details$DescriptorImpl.newInstance(HudsonPrivateSecurityRealm.java:501) at hudson.model.User.doConfigSubmit(User.java:520) 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.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288) at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:28) at org.kohsuke.stapler.Function$InterceptedFunction.invoke(Function.java:389) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574) ... 58 more It seems it appears with the use of a BCrypt class coming from org.mindrot:jbcrypt:0.3m added on this commit to the pom.xml : https://github.com/jenkinsci/jenkins/commit/9bdaf8daaf0798c7aa740c44b1fccbef20858bad

    Jenkins JIRA | 4 years ago | Ludovic Meurillon
    javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: Bad version number in .class file

    34 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.UnsupportedClassVersionError

      Bad version number in .class file

      at java.lang.ClassLoader.defineClass1()
    2. Java RT
      URLClassLoader.findClass
      1. java.lang.ClassLoader.defineClass1(Native Method)
      2. java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      3. java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      4. java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      5. java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      6. java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      7. java.security.AccessController.doPrivileged(Native Method)
      8. java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      8 frames
    3. winstone.classLoader
      WebappClassLoader.loadClass
      1. winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68)
      1 frame
    4. Java RT
      ClassLoader.loadClassInternal
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      2. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      2 frames
    5. Hudson
      Permission.<clinit>
      1. hudson.security.PermissionScope.<init>(PermissionScope.java:70)
      2. hudson.security.PermissionScope.<clinit>(PermissionScope.java:95)
      3. hudson.security.Permission.<init>(Permission.java:179)
      4. hudson.security.Permission.<clinit>(Permission.java:292)
      4 frames
    6. jenkins.model
      Jenkins.<clinit>
      1. jenkins.model.Jenkins.<clinit>(Jenkins.java:3817)
      1 frame
    7. Hudson
      WebAppMain.contextInitialized
      1. hudson.WebAppMain.installLogger(WebAppMain.java:256)
      2. hudson.WebAppMain.contextInitialized(WebAppMain.java:107)
      2 frames
    8. winstone
      Launcher.main
      1. winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:875)
      2. winstone.HostConfiguration.initWebApp(HostConfiguration.java:129)
      3. winstone.HostConfiguration.<init>(HostConfiguration.java:71)
      4. winstone.HostGroup.initHost(HostGroup.java:87)
      5. winstone.HostGroup.<init>(HostGroup.java:47)
      6. winstone.Launcher.<init>(Launcher.java:177)
      7. winstone.Launcher.main(Launcher.java:384)
      7 frames
    9. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    10. Unknown
      Main.main
      1. Main._main(Main.java:273)
      2. Main.main(Main.java:98)
      2 frames