users@glassfish.java.net

Re: JPA/Hibernate not working with Glassfish :(

From: <glassfish_at_javadesktop.org>
Date: Thu, 14 Aug 2008 05:45:10 PDT

Hello Marina,

I tried what you mentioned. I created a netbeans enterprise project which generates a ear.
I put the jpa entities and the stateless session bean in an ejb module and included it in the ear project together with the web application project.

test-enterprise.ear
- META-INF
- test-persistence-ejb.jar
- test-web-war.war

It starts up fine with this in the log file which seems to be fine:
------------------------------------------------------------------
[#|2008-08-14T13:57:56.999+0200|INFO|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=10;_ThreadName=main;java:comp/env/com.test.service.jpa.BookBean/em;|naming.bind|#]

[#|2008-08-14T13:57:57.009+0200|INFO|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=10;_ThreadName=main;test-enterprise;|LDR5010: All ejb(s) of [ErgoRR-enterprise] loaded successfully!|#]
------------------------------------------------------------------

but again when i try to invoke the web service the em.persist fails saying that the entitymanager is null. Digging deeper into the problem :s

thanks again
[Message sent by forum member 'marlor' (marlor)]

http://forums.java.net/jive/thread.jspa?messageID=293317