users@glassfish.java.net

Application load order error?

From: Adam Jenkins <adamjenkinstmpredirect_at_yahoo.com.au>
Date: Tue, 24 Feb 2009 14:15:18 -0800 (PST)

Hi All, I have a perplexing problem I can't seem to find any solution (google) for. I have an enteprise application (EAR) which contains an EJB jar and an application client module (webstart)...both working fine. I have a web application (deployed seperately to the EAR) that uses an ejb client jar (just the remote interfaces and domain objects) to communicate with the EJBs. The web application (JSF application) uses annotations to load the EJBs, example: @EJB( name="SystemBean", mappedName="ejb/SystemBean" ) private SystemRemote systemOps; I use this in JSF managed beans and in servlets no problems...everything works fine. However: When I put the exact same annotated member variable on a servlet filter or session listener, I get the following error: Exception attempting to inject Unresolved Ejb-Ref Now, I'm guessing (just guessing) this is because session listeners and filters are instantiated too early in the process...i.e. they're being instantiated before the EJBs have been bound into JNDI. Is there anyway in Glassfish to resolve this (has anyone hit this before?) Is there anyway to specify an application startup order? Cheers Adam Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox