Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370975

Summary: JPA tests in J2SE failed with JDK1.7
Product: z_Archived Reporter: Yiping Zhao <yiping.zhao>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P2 CC: dbb.posting, eclipselink.orm-inbox, jamesssss, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
tom.ware: iplog+
update to allow disabling the change
none
updated patch for disabling the change none

Description Yiping Zhao CLA 2012-02-08 11:40:02 EST
46 out of 78 tests in OracleJPATestSuite, one test "JPAAdvancedTestModel" in AllCMP3TestRunModel and 6 out of 7 tests in BeanValidationJunitTest failed with JDK1.7.0_02 since Jan 25th 2012 with following exceptions:

1. loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "org/eclipse/persistence/testing/models/jpa/inherited/NodeImpl" 

java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "org/eclipse/persistence/testing/models/jpa/inherited/NodeImpl"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:119)
at org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1320)
at org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:431)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:432)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:303)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:281)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.getServerSession(JUnitTestCase.java:450)
at org.eclipse.persistence.testing.tests.jpa.proxyauthentication.ProxyAuthenticationTestSuite.setUp(ProxyAuthenticationTestSuite.java:126)

2. 
Exception [EclipseLink-4021] (Eclipse Persistence Services - 2.4.0.v20120125-r10738): org.eclipse.persistence.exceptions.DatabaseException Exception Description: Unable to acquire a connection from driver [null], user [null] and URL [null]. Verify that you have set the expected driver class and URL. Check your login, persistence.xml or sessions.xml resource. The jdbc.driver property should be set to a class that is compatible with your database platform 

javax.persistence.PersistenceException: Exception [EclipseLink-4021] (Eclipse Persistence Services - 2.4.0.v20120125-r10738): org.eclipse.persistence.exceptions.DatabaseException
Exception Description: Unable to acquire a connection from driver [null], user [null] and URL [null]. Verify that you have set the expected driver class and URL. Check your login, persistence.xml or sessions.xml resource. The jdbc.driver property should be set to a class that is compatible with your database platform
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:521)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:303)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:281)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.getServerSession(JUnitTestCase.java:450)
at org.eclipse.persistence.testing.tests.jpa.proxyauthentication.ProxyAuthenticationTestSuite.setUp(ProxyAuthenticationTestSuite.java:126)


Note: James said the failures are caused by his changes on Jan 23rd in revision 10722 as for bug fix of 366426
Comment 1 James Sutherland CLA 2012-02-08 14:04:42 EST
See bug#358287
Comment 2 Tom Ware CLA 2012-03-08 10:18:53 EST
Created attachment 212296 [details]
Proposed fix

Patch takes advantage of suggestions provided by ASM team here:

http://www.eclipse.org/forums/index.php/mv/msg/264241/762520/#msg_762520

Some ASM-provided code included covered by: CQ 5108
Comment 3 Tom Ware CLA 2012-03-08 13:35:14 EST
Fix checked into 2.3 and trunk

This fix takes advantage of the suggestion by the ASM tean as to how to address this issue with ASM

Review: James Sutherland (pending)

added Test to InheritedModelJunitTest.  Also tested with the Oracle JPA tests on the Test Browser.
Comment 4 Tom Ware CLA 2012-03-08 13:36:09 EST
*** Bug 358287 has been marked as a duplicate of this bug. ***
Comment 5 Tom Ware CLA 2012-03-12 09:03:59 EDT
*** Bug 365385 has been marked as a duplicate of this bug. ***
Comment 6 Tom Ware CLA 2012-03-27 11:16:00 EDT
Created attachment 213238 [details]
update to allow disabling the change
Comment 7 Tom Ware CLA 2012-03-28 09:32:10 EDT
Created attachment 213291 [details]
updated patch for disabling the change
Comment 8 Tom Ware CLA 2012-03-28 09:33:09 EDT
Checked in additional change above.  Tested manually.
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:22:46 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink