users@glassfish.java.net

Re: error

From: cinhtau <cinhtau_at_gmail.com>
Date: Fri, 17 Dec 2010 06:24:55 -0800 (PST)

Manish Mishra-2 wrote:
>
> public class DemoWebServices {
> @PersistenceUnit
> private EntityManagerFactory emf;
>
> private EntityManager getEntityManager() {
> return emf.createEntityManager();
> }
> }
>

Usually you let the container handle the PersistenceUnit, i.e.

@PersistenceUnit(name="myPUnit")

Glassfish will inject it for you. Your code above is useless, because you
create an entity manager manually. You use that only outside Glassfish. Post
your persistence.xml please for further help.
-- 
View this message in context: http://old.nabble.com/error-tp30474866p30481279.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.