persistence@glassfish.java.net

Re: new to glassfish and EJB3- problem with EntityManager

From: Bob Treacy <bobtreacy_at_yahoo.com>
Date: Mon, 26 Jun 2006 13:57:18 -0700 (PDT)

That was it. Now I'm getting injection.

Thanks,
Bob Treacy

--- Kenneth Saks <Kenneth.Saks_at_Sun.COM> wrote:

> 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?
> >
> Hi Bob,
>
> Can you post the stack trace? How are you accessing
> the local session
> bean? Make sure you are using either @EJB or a
> lookup to access
> the local ejb reference instead of directly
> instantiating the StudyFacade
> class.
>
> --ken
>
> >
> >@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
> >
> >
>
>
>