[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Unrecognized persistence provider

Hi, 
    James is right - it looks like your classes are instrumented already.  I
looked at the EclipseLink code again and it is the entities that are being
iterated - not the persistence providers.
    For the stack trace, yes, it means that the OpenJPA jars are missing
from the classpath.
    I would inspect your .class bytecode by compiling the entities somewhere
you can gaurantee that nothing else is in the classpath and do a diff or
comparison of the ones you are running with in a jar or classes dir.
    An example of the difference can be seen in a screencap of a diff of
statically weaved (instrumented) .class files below.

http://wiki.eclipse.org/EclipseLink/Examples/JPA/Migration/JBoss#Weaving_or_Instrumentation

    thank you
    /michael


RMMM wrote:
> 
> I'm trying to figure out a puzzling exception in my app. I'm using
> Eclipslink for JPA. I have the line
>    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> in my persistence.xml. However, I'm getting an exception when I reach the
> line
> EntityManagerFactory emf =
> Persistence.createEntityManagerFactory("LetterPU", map);
> 
> The exception trace is:
> 
> WARNING: Found unrecognized persistence provider
> "org.eclipse.persistence.jpa.PersistenceProvider" in place of OpenJPA
> provider.  This provider's properties will not be used.
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/openjpa/enhance/PersistenceCapable
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at
> org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.loadClass(PersistenceUnitProcessor.java:261)
>         at
> org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.initPersistenceUnitClasses(MetadataProcessor.java:247)
>         at
> org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processEntityMappings(MetadataProcessor.java:422)
>         at
> org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:296)
>         at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:830)
>         at
> org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:101)
>         at
> org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:149)
>         at
> org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initialize(JPAInitializer.java:135)
>         at
> org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:104)
>         at
> org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:64)
>         at
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
>         at
> com.magicballbingo.yboard.Main.initializePersistence(Main.java:166)
>         at com.magicballbingo.yboard.Main.main(Main.java:54)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.openjpa.enhance.PersistenceCapable
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
>         ... 25 more
> 
> 
> Now, I've never used or called for OpenJPA. I don't have any idea what's
> trying to load OpenJPA or why. My only imports are:
> 
> import java.io.FileReader;
> import java.io.FileNotFoundException;
> import java.io.IOException;
> import java.util.HashMap;
> import java.util.Map;
> 
> import javax.persistence.Persistence;
> import javax.persistence.EntityManager;
> import javax.persistence.EntityManagerFactory;
> 
> import javax.jms.ConnectionFactory;
> 
> import org.apache.log4j.Logger;
> import org.apache.log4j.PropertyConfigurator;
> 
> import org.eclipse.persistence.config.PersistenceUnitProperties;
> 
>         
> 
> Any ideas?
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Unrecognized-persistence-provider-tp18976420p18989345.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.