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

RMMM, Hi,
	The part of the code that is failing is looping through all persistence
providers in your classpath.
	It looks like it found your default-shipped OpenJPA provider first, try
putting the eclipselink.jar higher in your classpath or temporarily
removing/disabling the OpenJPA jars.
	
	If you are running one of the following containers like Geronimo, WebSphere
6.1, Spring 2 or WebLogic 10 you may run into this issue.
	http://openjpa.apache.org/powered-by.html

	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-tp18976420p18988435.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.