openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2184) Exception when <exclude-unlisted-classes> element is used within persistence.xml
Date Fri, 25 May 2012 14:12:23 GMT

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

Rick Curtis commented on OPENJPA-2184:
--------------------------------------

What JDK are you using at runtime?
                
> Exception when <exclude-unlisted-classes> element is used within persistence.xml
> --------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2184
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2184
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.2.0
>         Environment: JavaSE
>            Reporter: Lucas Smith
>
> Here is my persistence.xml content:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
>   <persistence-unit name="derbyPU" transaction-type="RESOURCE_LOCAL">
>     <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>     <exclude-unlisted-classes>false</exclude-unlisted-classes>
>     <properties>
>       <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.ClientDriver"
/>
>       <property name="openjpa.ConnectionURL" value="jdbc:derby://localhost:1527/hibernate;create=true"
/>
>       <property name="openjpa.ConnectionUserName" value="hibernate" />
>       <property name="openjpa.ConnectionPassword" value="hibernate" />
>       <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='drop,add,deleteTableContents',IgnoreErrors=true)"
/>
>       <property name="openjpa.Log" value="DefaultLevel=WARN,SQL=TRACE" />
>       <property name="openjpa.jdbc.DBDictionary" value="derby(NextSequenceQuery=VALUES
NEXT VALUE FOR {0})"/>
>     </properties>
>   </persistence-unit>
> </persistence>
> Such configuration produses the following exception:
> 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"
> 	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:506)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.setConfiguration(DBDictionary.java:4633)
> 	at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:486)
> 	at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
> 	at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:199)
> 	at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:66)
> 	at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:579)
> 	at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
> 	at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
> 	at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
> 	at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
> 	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:968)
> 	at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
> 	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)
> I have already used java 5, 6 and 7 compilers. They all give the same exception.
> However, when I delete <exclude-unlisted-classes>false</exclude-unlisted-classes>
element and declare classes explicitly (using <class> elements) everything works like
a charm.
> I am using Open JPA in Java SE environment. I have 'openjpa-all-2.2.0.jar' in my class
and build paths.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message