Hardy Ferentschik commented on Bug HV-702

Upgrading to :

<dependency>
  <groupId>org.hibernate.javax.persistence</groupId>
  <artifactId>hibernate-jpa-2.1-api</artifactId>
  <version>1.0.0.Draft-10</version>
</dependency>

causes the following exception using Java 6:

org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
	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:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
Caused by: java.lang.UnsupportedClassVersionError: javax/persistence/Entity : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	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.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
	at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:181)
	at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
	at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
	at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070)
	at java.lang.Class.getAnnotation(Class.java:3029)
	at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotationInSuperClasses(JDK15AnnotationFinder.java:84)
	at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:150)
	at org.testng.internal.TestNGClassFinder.isTestNGClass(TestNGClassFinder.java:230)
	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:107)
	at org.testng.TestRunner.initMethods(TestRunner.java:409)
	at org.testng.TestRunner.init(TestRunner.java:235)
	at org.testng.TestRunner.init(TestRunner.java:205)
	at org.testng.TestRunner.<init>(TestRunner.java:153)
	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522)
	at org.testng.SuiteRunner.init(SuiteRunner.java:157)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1273)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1260)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1114)
	at org.testng.TestNG.run(TestNG.java:1031)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:177)
	at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:105)
	... 9 more

Results :

Seems the API is compiled using JDK 7. Is this necessary?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira