-
Bug
-
Resolution: Done
-
Major
-
1.0.0.Alpha5
-
None
When using Arquillian 1.0.0.Alpha5 or SNAPSHOT versions on a Sun JDK version 1.5, the following error occurs:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
(stack trace below)
The error occurs on the first line in this getType() method:
InjectionPointImpl.class
------------------------
@Override
public Type getType()
{
ParameterizedType type = (ParameterizedType) field.getGenericType();
if(type.getActualTypeArguments()[0] instanceof ParameterizedType)
{ ParameterizedType first = (ParameterizedType)type.getActualTypeArguments()[0]; return (Class<?>)first.getRawType(); }else
{ return (Class<?>)type.getActualTypeArguments()[0]; }}
It only occurs when the instance producer is for an ArquillianDescriptor which extends a newly used
Descriptor from ShrinkWrap. It appears that ShrinkWrap was compiled only for Java 1.6.
The field being injected is this one:
private org.jboss.arquillian.spi.core.InstanceProducer org.jboss.arquillian.impl.bootstrap.ConfigurationRegistrar.descriptorInst
The templated type is this descriptor:
org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor extends org.jboss.shrinkwrap.descriptor.api.Descriptor
...and these are the header infos from the corresponding classes:
// Compiled from Descriptor.java (version 1.6 : 50.0, no super bit)
public abstract interface org.jboss.shrinkwrap.descriptor.api.Descriptor {
// Compiled from ArquillianDescriptor.java (version 1.5 : 49.0, no super bit)
public abstract interface org.jboss.arquillian.impl.configuration.api.ArquillianDescriptor extends org.jboss.shrinkwrap.descriptor.api.Descriptor {
The ArquillianDescriptor was probably compiled with Java 1.6, but set to target version 1.5
The full stack trace is as follows:
-----------------------------------
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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:50)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:120)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:67)
at java.lang.reflect.Field.getGenericType(Field.java:222)
at org.jboss.arquillian.impl.core.InjectionPointImpl.getType(InjectionPointImpl.java:66)
at org.jboss.arquillian.impl.core.ManagerImpl.injectInstances(ManagerImpl.java:443)
at org.jboss.arquillian.impl.core.ManagerImpl.inject(ManagerImpl.java:432)
at org.jboss.arquillian.impl.core.ManagerImpl.createExtensions(ManagerImpl.java:330)
at org.jboss.arquillian.impl.core.ManagerImpl.<init>(ManagerImpl.java:82)
at org.jboss.arquillian.impl.core.ManagerBuilder.create(ManagerBuilder.java:74)
at org.jboss.arquillian.impl.DeployableTestBuilder.build(DeployableTestBuilder.java:97)
at org.jboss.arquillian.impl.DeployableTestBuilder.build(DeployableTestBuilder.java:67)
at org.jboss.arquillian.junit.Arquillian.<init>(Arquillian.java:82)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:32)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:41)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)