Bug 341446 - java.lang.UnsupportedClassVersionError when running Java 1.5
Summary: java.lang.UnsupportedClassVersionError when running Java 1.5
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Runtime (show other bugs)
Version: 1.6.8   Edit
Hardware: All All
: P1 critical (vote)
Target Milestone: 1.6.12   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-31 02:20 EDT by Robert Klaus CLA
Modified: 2011-04-11 16:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Klaus CLA 2011-03-31 02:20:53 EDT
We are using Spring 3.0 and they have a dependency to aspectj. Thus we have the runtime Jars on the classpath.

Problem is the aspectjweaver.jar contains 1.6 byte code. When starting our application on JBoss 5.1 with JDK 1.5 we get an exception in the logs:

Unexpected error during load of:testdata.SomeAnnotation
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 org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
at java.security.AccessController.doPrivileged(Native Method)

As we are not using aspects from aspectj we don't have a problem ... but others might have. There is a issue for Spring as well:

https://issuetracker.springsource.com/browse/EBR-622

Also had a look at the current release 1.6.11 and the same situation there.

So as other people have no chance of working around this (other than building the jar themself) I set this to major.
Comment 1 Andrew Clement CLA 2011-03-31 23:49:23 EDT
It is actually some rogue testdata classes that have been packaged into the distribution, 3 of them, in the testdata package.  All the main classes are of the correct level (1.3/1.5).   I've just committed some changes to ensure the testdata code isn't packaged up.  I *might* rebuild the 1.6.11 release to remove them.
Comment 2 Andrew Clement CLA 2011-04-11 16:53:42 EDT
The latest 1.6.12 snapshots available in our (springsource) maven repo have this fixed.  I am not going to rebuild 1.6.11 right now