You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "garpinc (JIRA)" <ji...@apache.org> on 2013/07/17 00:20:48 UTC

[jira] [Commented] (OPENJPA-2399) Oracle JDK 1.7 seems to be causing an issue with OpenJPA

    [ https://issues.apache.org/jira/browse/OPENJPA-2399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13710372#comment-13710372 ] 

garpinc commented on OPENJPA-2399:
----------------------------------

Ok I've found exactly where openjpa operates differently in JDK 1.6 and JDK 1.7

Either:
1) jdk 1.7 has a bug OR
2) openjpa utilized functionality that was in 1.6 but was a bug fix in 1.7 and hence openjpa can not depend on the previous behavior

Here is the stack trace in 1.6 where ClassCircularityError is raised and later caught in PCClassFileTransformer.needsEnhance as a Linkage error on line 207 (trunk):

org.eclipse.jdt.internal.junit.runner.RemoteTestRunner at localhost:53304	
	Thread [main] (Suspended (breakpoint at line 36 in LinkageError))	
		owns: Launcher$AppClassLoader  (id=1166)	
		ClassCircularityError(LinkageError).<init>(String) line: 36	
		ClassCircularityError.<init>(String) line: 32	
		Class<T>.forName0(String, boolean, ClassLoader) line: not available [native method]	
		Class<T>.forName(String, boolean, ClassLoader) line: 249	
		TemporaryClassLoader.loadClass(String, boolean) line: 78	
		TemporaryClassLoader.loadClass(String) line: 44	
		Class<T>.forName0(String, boolean, ClassLoader) line: not available [native method]	
		Class<T>.forName(String, boolean, ClassLoader) line: 249	
		PCClassFileTransformer.needsEnhance(String, Class, byte[]) line: 198	
		PCClassFileTransformer.transform0(String, Class, byte[]) line: 139	
		PCClassFileTransformer.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 126	
		TransformerManager.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 169	
		InstrumentationImpl.transform(ClassLoader, String, Class, ProtectionDomain, byte[], boolean) line: 365	
		ClassLoader.defineClass1(String, byte[], int, int, ProtectionDomain, String, boolean) line: not available [native method]	

In JDK 1.7 the error is not raised and hence not caught and if you step into the forName0 you'll instead end up a the following stack position:
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner at localhost:53419	
	Thread [main] (Suspended)	
		owns: Object  (id=4827)	
		String.lastIndexOf(int) line: 1591	
		Launcher$AppClassLoader.loadClass(String, boolean) line: 301	
		Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 357	
		Class<T>.forName0(String, boolean, ClassLoader) line: not available [native method]	
		Class<T>.forName(String, boolean, ClassLoader) line: 270	
		TemporaryClassLoader.loadClass(String, boolean) line: 78	
		TemporaryClassLoader.loadClass(String) line: 44	
		Class<T>.forName0(String, boolean, ClassLoader) line: not available [native method]	
		Class<T>.forName(String, boolean, ClassLoader) line: 270	
		PCClassFileTransformer.needsEnhance(String, Class, byte[]) line: 198	
		PCClassFileTransformer.transform0(String, Class, byte[]) line: 139	
		PCClassFileTransformer.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 126	
		TransformerManager.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 188	
		InstrumentationImpl.transform(ClassLoader, String, Class, ProtectionDomain, byte[], boolean) line: 424	
		ClassLoader.defineClass1(String, byte[], int, int, ProtectionDomain, String) line: not available [native method]	

                
> Oracle JDK 1.7 seems to be causing an issue with OpenJPA
> --------------------------------------------------------
>
>                 Key: OPENJPA-2399
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2399
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.0, 2.3.0, 2.2.2
>            Reporter: garpinc
>
> I recently had to upgrade to JDK 1.7 and I'm having
> java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "org/apache/openjpa/jdbc/identifier/DBIdentifier$DBIdentifierType"
> I previously reported this sometime ago here:
> http://openjpa.208410.n2.nabble.com/JDK-1-7-seems-to-be-causing-an-issue-with-latest-snapshot-td7581417.html#a7583248
> seems there has been no resolution. I've tried 2.2.0, 2.2.1 and 2.3.0-SNAPSHOT and all have same issue on Oracle JDK 1.7. Can someone please advise?

--
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