aspose file tools*
The moose likes Object Relational Mapping and the fly likes  No Persistence provider for EntityManager named helloworld Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " No Persistence provider for EntityManager named helloworld" Watch " No Persistence provider for EntityManager named helloworld" New topic
Author

No Persistence provider for EntityManager named helloworld

ArunKumar Kandregula
Greenhorn

Joined: Jun 05, 2009
Posts: 10
I am using maven to get the jars. I have META-INF/persistence.xml in src/main/resource.


Following is my java code.



Output :

/D:/arun/mavenprojects/hibernateHawa/target/classes/
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/org/hibernate/hibernate/3.2.2.ga/hibernate-3.2.2.ga.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/org/hibernate/hibernate-annotations/3.2.1.ga/hibernate-annotations-3.2.1.ga.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/org/hibernate/hibernate-entitymanager/3.2.1.ga/hibernate-entitymanager-3.2.1.ga.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/jboss/javassist/3.3.ga/javassist-3.3.ga.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/jboss/jboss-archive-browsing/5.0.0alpha-200607201-119/jboss-archive-browsing-5.0.0alpha-200607201-119.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/org/hibernate/hibernate-tools/3.2.0.beta9a/hibernate-tools-3.2.0.beta9a.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/freemarker/freemarker/2.3.4/freemarker-2.3.4.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/org/springframework/spring/2.5.6.SEC02/spring-2.5.6.SEC02.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar
/C:/Documents%20and%20Settings/arkandre.ST-USERS/.m2/repository/commons-pool/commons-pool/1.3/commons-pool-1.3.jar
Feb 21, 2011 8:20:57 PM org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.2.1.GA
Feb 21, 2011 8:20:57 PM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.2.1.GA
Feb 21, 2011 8:20:57 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.2
Feb 21, 2011 8:20:57 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Feb 21, 2011 8:20:57 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
Feb 21, 2011 8:20:57 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named helloworld
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
at EMPersistDemo.main(EMPersistDemo.java:33)


I tried my best to find out why I am getting this error.
Most of the google results show that either I am missing META-INF/persistence.xml in CLASSPATH or I am not having hibernate-entitymanager.jar in CLASSPATH.

But it is very clear that I have target\classes\META-INF\persistence.xml and target\classes is in CLASSPATH as is evident from above.
It is also clear that hibernate-entitymanager.jar is in the CLASSPATH. I dont know why I am still getting this error.


Please help me !



Thank you, Arun Kumar Kandregula.
SCJP 1.4 98%, SCBCD 1.3 92%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No Persistence provider for EntityManager named helloworld
 
Similar Threads
dependency isn't published
How to copy generated wsdl file to WAR file?
Cannot find setter nor field in org.apache.maven.plugins.site.ReportPlugin
Problems in making an executable jar file thru Maven
Trouble with running Maven Tomcat plugin through Eclipse