users@glassfish.java.net

Re: Application load order error?

From: Sahoo <sahoo_at_sun.com>
Date: Wed, 25 Feb 2009 09:49:37 +0530

That's weired, as GlassFish does load EJB modules first before loading
any web modules in an ear file. You are possibly hitting a bug
somewhere. Unless Ken can come up with some other explanation, I suggest
you to file a bug.

Can you try one more alternative? Since the EJB is in the same ear as
the web module, can you use /beanName/ attribute as opposed to
/mappedName/ to link the ejb-ref to the target ejb. i.e., change your
code like this:

@EJB(name="SystemBean", beanName="SystemBean")
private SystemRemote systemOps;

GlassFish EJB FAQ [1] contains excellent information on use of @EJB.

Thanks,
Sahoo

[1] https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

Adam Jenkins wrote:
> Removed name attribute from the @EJB annotation: No change, same error
> Perform explicit lookup in Filter init method: works fine
>
> It looks like it's just a timing issue. The web application must be
> starting up first, before the enterprise application with the EJBs in
> it. And since the filters and listeners are instantiated and injected
> on startup, it's trying to lookup an EJB that isn't bound to JNDI yet.
>
> Is there anyway to tell glassfish to load the enterprise application
> first?
>
> Cheers
> Adam
>
>
>
> --- On *Wed, 25/2/09, glassfish_at_javadesktop.org
> /<glassfish_at_javadesktop.org>/* wrote:
>
>
> From: glassfish_at_javadesktop.org <glassfish_at_javadesktop.org>
> Subject: Re: Application load order error?
> To: users_at_glassfish.dev.java.net
> Received: Wednesday, 25 February, 2009, 10:43 AM
>
> Not sure why the injection is failing. Can you try removing the
> name() attribute from each of the injected fields and re-running.
>
> Also, if you do the following explicit global lookup from within
> the filter does it work?
>
> (SystemRemote) new InitialContext().lookup("ejb/SystemBean")
> [Message sent by forum member 'ksak' (ksak)]
>
> http://forums.java.net/jive/thread.jspa?messageID=333652
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> </mc/compose?to=users-unsubscribe_at_glassfish.dev.java.net>
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> </mc/compose?to=users-help_at_glassfish.dev.java.net>
>
>
> ------------------------------------------------------------------------
> Stay connected to the people that matter most with a smarter inbox.
> Take a look
> <http://au.rd.yahoo.com/galaxy/mail/tagline2/*http://au.docs.yahoo.com/mail/smarterinbox>.