[
https://issues.apache.org/jira/browse/OPENJPA-2399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13683638#comment-13683638
]
garpinc commented on OPENJPA-2399:
----------------------------------
I'm not so sure as I also get the problem when doing api driven build time
enhancement with PCEnhancer.run(ojc, eargs, eflags, null, writer,
classLoader);
The error I get is slightly different than yours Rick and it occurs when
creating the EntityManager long after the enhancement has already been done.
I'm using jdk1.7.0_10 and here is my stack trace.
java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader):
attempted duplicate class definition for name:
"org/apache/openjpa/jdbc/identifier/DBIdentifier$DBIdentifierType"
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
org.apache.openjpa.jdbc.sql.DBDictionary.configureNamingRules(DBDictionary.java:520)
at
org.apache.openjpa.jdbc.sql.DBDictionary.setConfiguration(DBDictionary.java:4672)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:504)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:461)
at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:199)
at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:100)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
at
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1518)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:536)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:461)
at
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:121)
at
org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
at
org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:967)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:958)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:646)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
at
com.cambridgesemantics.anzo.relationalreplicator.ReplicationJob$ClassloaderDrivenEntityManagerFactory.createEntityManager(ReplicationJob.java:351)
at
com.cambridgesemantics.anzo.relationalreplicator.ReplicationJob.initializeEntityManagers(ReplicationJob.java:631)
at
com.cambridgesemantics.anzo.relationalreplicator.ReplicationJob.dropSchemaAndRecreate(ReplicationJob.java:696)
at
com.cambridgesemantics.anzo.regress.relationalreplicator.AbstractRelationalReplicatorServiceFilmDCTest.loadData(AbstractRelationalReplicatorServiceFilmDCTest.java:30)
at
com.cambridgesemantics.anzo.regress.relationalreplicator.AbstractRelationalReplicatorServiceDCTest.setUp(AbstractRelationalReplicatorServiceDCTest.java:65)
at junit.framework.TestCase.runBare(TestCase.java:128)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
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)
> 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