http://kickjava.com/src/WhichClass.java.htm
A nice example of how to find a class in your class path so you can understand what is being found where. Chris -----Original Message----- From: stlecho [mailto:stle...@gmail.com] Sent: Wednesday, 26 May 2010 8:27 PM To: users@openjpa.apache.org Subject: Duplicate class definition for name: "sun/security/mscapi/SunMSCAPI" I've created a small project with some entities and 1 named query. When launching a test with the "-javaagent" option, I'm getting an error: "duplicate class definition for name: "sun/security/mscapi/SunMSCAPI"" (see below for complete stacktrace). When running the same test withiut the "-javaagent" option, I'm getting another error: "org.apache.openjpa.persistence.ArgumentException: 0" (see http://openjpa.208410.n2.nabble.com/ArgumentException-when-using-generics-tp 5073975p5073975.html). The version of OpenJPA I'm using is v1.2.2. I would be pleased if someone could help me with this issue. [stacktrace] Caused by: <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: java.lang.LinkageError: loader (instance of sun/misc/Launcher$ExtClassLoader): attempted duplicate class definition for name: "sun/security/mscapi/SunMSCAPI" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:296) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:234) at java.security.AccessController.doPrivileged(Native Method) at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:225) at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:205) at sun.security.jca.ProviderList.loadAll(ProviderList.java:264) at sun.security.jca.ProviderList.removeInvalid(ProviderList.java:281) at sun.security.jca.Providers.getFullProviderList(Providers.java:158) at java.security.Security.getProviders(Security.java:421) at java.security.Security.getProviders(Security.java:570) at java.security.Security.getProviders(Security.java:515) at org.apache.derby.client.am.EncryptionManager.<init>(Unknown Source) at org.apache.derby.jdbc.ClientBaseDataSource.<clinit>(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObj ectBuilder.java:275) at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSou rceObjectBuilder.java:108) at com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFact ory.java:1167) at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnection Factory.java:135) at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManaged ConnectionFactory.java:90) at com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResour ce(LocalTxConnectorAllocator.java:72) ... [/stacktrace] -- View this message in context: http://openjpa.208410.n2.nabble.com/Duplicate-class-definition-for-name-sun- security-mscapi-SunMSCAPI-tp5102765p5102765.html Sent from the OpenJPA Users mailing list archive at Nabble.com.