persistence@glassfish.java.net

Re: new to glassfish and EJB3- problem with EntityManager

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Mon, 26 Jun 2006 07:37:17 +0530

Looks like entity manager was not injected at all. Have you verified
your app? Run this command to verify:
$GLASSFISH_HOME/bin/verifier <ear/jar/war file>

Thanks,
Sahoo
Bob Treacy wrote:
> I am just getting started with Glassfish and EJB3.
> What could be causing the first line of findAll()
> below to be generating a NullPointerException?
>
> @Stateless
> public class StudyFacade implements StudyFacadeLocal {
>
> @PersistenceContext
> private EntityManager em;
> ...
> public List findAll() {
> Query q = em.createQuery("SELECT object(s)
> from Study as s");
> ..
>
> }
>
> Thanks,
> Bob Treacy
>