No Persistence provider for EntityManager
5 September 2008You might have encountered the following exception while working with hibernate:
[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.
\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.
Related Posts:
- Java Persistence API - annotations - I
- Java Persistence API - annotations - III
- Java Persistence API - annotations - II
- JDO – Byte Code Enhancement
- JNDI - intro
- Creating a Simple Plug-in using PDE (II)
- Asynchronous method calls - II
- Java Naming and Directory Interface - II
- Accessing Beans (EJB)
- Jboss-4.0.2 hibernate bug
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: No Persistence provider for EntityManager