tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wlad <vvo...@yahoo.com>
Subject Getting exception: "java.lang.LinkageError:" ... attempted duplicate class definition for name...
Date Thu, 03 Oct 2013 16:36:41 GMT
Hi,
I am using Eclipse IDE, TomEE server and MySQL database.
I am working on simple JEE example that should demonstrate connecting to
database using EntityManagerFactory, EntityManager, EntityTransaction -
persist entities to database, find them by ID, update, remove.
All these operations are in "public static void main" method of client
class.

I have created database connection in Data Source Explorer, and ant tasks
for creating database (sql code for creating db). Database creation works
fine, but when I try to run client class I am getting next exception:

/Buildfile: /home/vladimir/workspace/MBS-Vezbe/V7/build.xml
runClient01:
     [java] Entity Manager Factory created
     [java] Exception in thread "main" java.lang.LinkageError: loader
(instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class
definition for name:
"org/apache/openjpa/jdbc/identifier/DBIdentifier$DBIdentifierType"
     [java] 	at java.lang.ClassLoader.defineClass1(Native Method)
     [java] 	at java.lang.ClassLoader.defineClass(ClassLoader.java:788)
     [java] 	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
     [java] 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:447)
     [java] 	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
     [java] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
     [java] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
     [java] 	at java.security.AccessController.doPrivileged(Native Method)
     [java] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
     [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     [java] 	at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
     [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     [java] 	at
org.apache.openjpa.jdbc.sql.DBDictionary.configureNamingRules(DBDictionary.java:506)
     [java] 	at
org.apache.openjpa.jdbc.sql.DBDictionary.setConfiguration(DBDictionary.java:4633)
     [java] 	at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:486)
     [java] 	at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
     [java] 	at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:199)
     [java] 	at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:66)
     [java] 	at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.calculateDBDictionary(DBDictionaryFactory.java:81)
     [java] 	at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:584)
     [java] 	at
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
     [java] 	at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
     [java] 	at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
     [java] 	at
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
     [java] 	at
org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
     [java] 	at
org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
     [java] 	at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
     [java] 	at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
     [java] 	at
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
     [java] 	at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
     [java] 	at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
     [java] 	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
     [java] 	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
     [java] 	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
     [java] 	at
rs.ac.uns.ftn.informatika.mbs2.vezbe07.primer01.client.TestClient.main(TestClient.java:23)
     [java] Java Result: 1
BUILD SUCCESSFUL
Total time: 2 seconds/

This exception happens when executing source code line: "EntityManager
manager = factory.createEntityManager();"



--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-exception-java-lang-LinkageError-attempted-duplicate-class-definition-for-name-tp4665401.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message