persistence@glassfish.java.net

Re: new to glassfish and EJB3- problem with EntityManager

From: Bob Treacy <bobtreacy_at_yahoo.com>
Date: Sun, 25 Jun 2006 20:32:01 -0700 (PDT)

BobTreacy:~/VDCPrototype/dist bobtreacy$ jar tf
VDCPrototype.ear
META-INF/
META-INF/MANIFEST.MF
jar/
J2EE.dpf
META-INF/application.xml
META-INF/sun-application.xml
VDCPrototype-ejb.jar
VDCPrototype-war.war
BobTreacy:~/VDCPrototype/dist bobtreacy$

There is no ejb-jar.xml, only sun-ejb-jar.xml which is
basically empty. I am using NetBeans 5.5 to generate
much of this


--- Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM> wrote:

> Thanks for that output. I am trying to find out why
> that warning
> appeared. Can you please do a jar tf on
> VDCPrototype.ear and send the
> output? Secondly, do you have an ejb-jar.xml in
> VDCPrototype-ejb.jar?
> What is *version* attribute set there? Is it 3.0 or
> not?
>
> Thanks,
> Sahoo
>
> Bob Treacy wrote:
> > BobTreacy:~/VDCPrototype/dist bobtreacy$
> > ~/glassfish/bin/verifier VDCPrototype.ear
> > WARNING: DPL5400:Exception occurred : error in
> > opening zip file.
> > INFO: Verifying: [ VDCPrototype.ear ]
> > INFO: Verifying: [ VDCPrototype-ejb_jar ]
> > Visiting non-standard Signature object
> > Visiting non-standard Signature object
> > INFO: Verifying: [ VDCPrototype-war_war ]
> > INFO: Compiling JSPs in [ VDCPrototype-war_war ]
> > Visiting non-standard Signature object
> > Visiting non-standard Signature object
> > INFO:
> > # of Failures : 0
> > # of Warnings : 0
> > # of Errors : 0
> > INFO: No errors found in the archive.
> > BobTreacy:~/VDCPrototype/dist bobtreacy$
> >
> >
> > --- Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
> wrote:
> >
> >
> >> 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
> >>>
> >>>
>