-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 
Author Message
 Post subject: Impossible to use helloworldjpa
PostPosted: Sun Dec 24, 2006 10:27 pm 
Newbie

Joined: Sun Dec 24, 2006 10:23 pm
Posts: 11
Hi,
i try to use the source code of the book but i always have the following errors:

Code:
C:\sources - java persistance with hibernate\jpwh-gettingstarted-061110\hellowor
ld-jpa>ant run
Buildfile: build.xml

compile:

copymetafiles:

run:
     [java] Exception in thread "main" javax.persistence.PersistenceException: N
o Persistence provider for EntityManager named helloworld
     [java]     at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:55)
     [java]     at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:33)
     [java]     at hello.HelloWorld.main(Unknown Source)
     [java] Java Result: 1

BUILD SUCCESSFUL
Total time: 1 second
C:\sources - java persistance with hibernate\jpwh-gettingstarted-061110\hellowor
ld-jpa>



Apparently my helloworld class don't know how to access the persistence.xml file..
Do you know how to solve this problem ?
Thanks


Top
 Profile  
 
 Post subject: hellworld-jpa
PostPosted: Tue Dec 26, 2006 4:38 pm 
Newbie

Joined: Sun Dec 24, 2006 10:23 pm
Posts: 11
Hi,
can you show me your output when you try to run the source code from the site ?
(I don't edit source code but i still have a javax.persistence.PersistenceException .
How can i have a persistance provider ?


Top
 Profile  
 
 Post subject: JPA Helloworld error
PostPosted: Fri Dec 29, 2006 5:28 pm 
Beginner
Beginner

Joined: Thu Aug 31, 2006 2:31 pm
Posts: 25
Location: USA
Hi I got the same error !
Well i was missing few jars in the class path . But it took hell lot of time for me as it is was not complaining about the missing Jars but it keep saying
"No Persistence provider for EntityManager named helloworld".
So I assume if you are trying this sample from the previous one you obvioulsly missed the following jars like me.
Jars files required (which i missed in my classpath.)
javaassit -
jboss-archiving-
hibernate-entitymanager-

if we still getting error u can download the source code and in the lib directory u can find all these jars..
I too downloaed from there but i was tryign to add the jars only when required.And the error message obviously did not helped in any way.

Hope this will solve your problem.
Regards,
Vinodh..[[/b]

All Jars required are as shown below
    \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

_________________
I am using a shitty e-mail filtering system that caused a lot of bounces for the admin of this forum. I need to turn on my brain next time and update my e-mail address.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 12:46 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Please use the release from December 11th, not the one from November.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 09, 2007 1:10 pm 
Beginner
Beginner

Joined: Sat Sep 04, 2004 7:07 am
Posts: 20
Location: Helsinki, Finland
The exception
Code:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named ...
comes because class org.hibernate.ejb.XHibernatePersistence is not found (?), the package hibernate-entitymanager.jar is not on the classpath.

The easiest way to get the missing jar's is to dowload Hibernate EntityManager and copy them from the /lib.

If the persistence provider jar and/or class is missing, the thrown exception is not classNotFound but this 'PersistenceException: No Persisten provider ...'
There seems to be various ways to get this exception.

_________________
Risto


Last edited by s5554 on Tue Jan 23, 2007 4:35 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 11, 2007 9:37 am 
Beginner
Beginner

Joined: Sat Sep 04, 2004 7:07 am
Posts: 20
Location: Helsinki, Finland
Having continued on the learning curve I notice that in my previous mail the question mark after the classname
Code:
org.hibernate.ejb.XHibernatePersistence
was more valid than I knew. The correct classname, which is given in persistence.xml is
Code:
org.hibernate.ejb.HibernatePersistence
No capital X in front of Hibernate. That was my typo, in book the classname is correct.

_________________
Risto


Top
 Profile  
 
 Post subject: Re: JPA Helloworld error
PostPosted: Wed Jan 24, 2007 3:04 am 
Newbie

Joined: Wed Jan 24, 2007 2:55 am
Posts: 1
vinodhts wrote:
Hi I got the same error !
Well i was missing few jars in the class path . But it took hell lot of time for me as it is was not complaining about the missing Jars but it keep saying
"No Persistence provider for EntityManager named helloworld".
So I assume if you are trying this sample from the previous one you obvioulsly missed the following jars like me.
Jars files required (which i missed in my classpath.)
javaassit -
jboss-archiving-
hibernate-entitymanager-

if we still getting error u can download the source code and in the lib directory u can find all these jars..
I too downloaed from there but i was tryign to add the jars only when required.And the error message obviously did not helped in any way.

Hope this will solve your problem.
Regards,
Vinodh..[[/b]

All Jars required are as shown below
    \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



It's OK for me.
I forgot to copy hibernate-entitymanager.jar into lib directory.


Top
 Profile  
 
 Post subject: it works!
PostPosted: Wed Jan 24, 2007 7:24 am 
Newbie

Joined: Sun Dec 24, 2006 10:23 pm
Posts: 11
Thanks you for your answers, now it works when i copy the new libs.


Top
 Profile  
 
 Post subject: same error
PostPosted: Thu Mar 15, 2007 5:48 pm 
Newbie

Joined: Thu Mar 15, 2007 5:37 pm
Posts: 4
Hi all,
I`m getting exactly the same error. I have all listed jars from latest builds in place and persistence.xml file in META-INF directory but I`m running my test client as a standalone app without any Apllication Server. Is that a problem or I have to do some more steps?
Has someone tried to use Hibernate EntityManager as a part of standalone app?

regards,
vs


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 16, 2007 12:09 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
If you download the Hello World package, and if you follow the README instructions step by step, is there a problem or does it work?

If your question is not about the Hello World package, but about Hibernate EntityManager in general, you are in the wrong forum.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: error
PostPosted: Fri Mar 16, 2007 8:47 am 
Newbie

Joined: Thu Mar 15, 2007 5:37 pm
Posts: 4
I`m sorry. I think I`m on the wrong topic.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 16, 2007 10:42 am 
Newbie

Joined: Fri Mar 16, 2007 10:33 am
Posts: 1
I have the same error , but all my jars are in my classpath, are There an other explanation to what's happening with my programm?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 16, 2007 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Are you talking about the Hello World package for the book or are you in the wrong forum like the previous poster?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Re:No Persistence provider for EntityManager named sample
PostPosted: Wed Dec 19, 2007 10:09 am 
Newbie

Joined: Wed Dec 19, 2007 10:06 am
Posts: 1
All Jars required are as shown below


\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




Add this tag <provider>org.hibernate.ejb.HibernatePersistence</provider> in your persistence.xml .Finally copy persistence.xml in META-INF folder. It will work .


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.