• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

No Persistence provider for EntityManager named helloworld

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !


 
Whatever you say buddy! And I believe this tiny ad too:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic