View RSS Feed

My Java Tips

No Persistence provider for EntityManager

Rate this Entry
by , 06-02-2011 at 07:15 PM (4111 Views)
You might have encountered the following exception while working with hibernate:

Java Code:
[java] Exception in thread "main" javax.persistence.PersistenceException: 
No Persistence provider for EntityManager named  ****
Make sure you have all the required jars in the class path.

Java Code:
      \antlr-2.7.6.jar
      \asm.jar
      \asm-attrs.jar
      \c3p0-0.9.0.jar
      \cglib-2.1.3.jar
      \commons-collections-2.1.1.jar
      \commons-logging-1.0.4.jar
      \dom4j-1.6.1.jar
      \ejb3-persistence.jar
      \hibernate3.jar
      \hibernate-annotations.jar
      \hibernate-entitymanager.jar
      \hibernate-tools.jar
      \hsqldb.jar
      \javassist.jar
      \jboss-archive-browsing.jar
      \jta.jar
      \lgpl.txt
      \log4j-1.2.13.jar
If the persistence provider jar is missing, one would expect a classNotFound exception but this 'PersistenceException: No Persistence provider ...' is thrown.

Hopes this helps.

Submit "No Persistence provider for EntityManager" to Facebook Submit "No Persistence provider for EntityManager" to Digg Submit "No Persistence provider for EntityManager" to del.icio.us Submit "No Persistence provider for EntityManager" to StumbleUpon Submit "No Persistence provider for EntityManager" to Google

Comments