glassfish « EntityManager « JPA Q&A

1. How can one debug/fix an everlasting null return from EntityManager's find?

I am following this example . I keep getting this error whenever calling upon find: java.lang.NullPointerException at LoginAction.service( at Dispatcher.doWork( at Dispatcher.doGet( ...

2. How to safely read related Entities from a detached Entity in JPA

I am trying to attach a related persisted entity to a transient entity. This works fine in GlassFish V2 but not in GlassFish V3. This is a very simple scenario. Please ...

3. Glassfish JPA: Problems injecting EntityManager

I am new to Java EE. I tried to get some first examples running (JPA). I am using Glassfish v3. The trouble is that I don't get the App Server injecting ...

4. Accessing Hibernate Session from EJB using EntityManager

Is it possible to obtain the Hibernate Session object from the EntityManager? I want to access some hibernate specific API... I already tried something like:

org.hibernate.Session hSession =
   ( (EntityManagerImpl) em.getDelegate() ...

5. Inject EntityManager with EJB

I'm trying to inject EntityManager in my DAO using EJB

public class Book {
    private int id;
    private ...

6. Need help with Glassfish, hibernate entitymanager and netbeans

Netbeans project4: com.mycompany.webservice (glassfish web app) attached you can find the persistence.xml file of the netbeans glassfish project I added all jar libs in the properties -> libraries of the netbeans project and chose to package those in the final war file, ran build, verify, deploy and get the following when trying to make a object creation