I am using Eclipse Java EE Edition. I cannot execute a query by using
the object of EntityManager. It throws a Null Pointer Exception in the
line which includes the statement "q.getResultList();". It says that
"No API environment is registered for this thread". What is the wrong
with this usage? I didn't try to upload my application to Google
server's anymore.

EntityManagerFactory emf =
Persistence.createEntityManagerFactory("transactions-optional");
                EntityManager em = emf.createEntityManager();
                ShineeUser u = new ShineeUser();
                u.setTitle("ilk user");
                String query = "select from " + ShineeUser.class.getName();
        try {
                em.persist(u);
                Query q = em.createQuery(query);
                q.getResultList();
        } finally {
         //
        }

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to