users@glassfish.java.net

Re: Unable to locate EJB remote interface from LifecycleListener class

From: <glassfish_at_javadesktop.org>
Date: Mon, 03 Sep 2007 05:21:06 PDT

From memory the lifecycle modules are loaded in a different class loader than the container managed stuff such as EJBs. This means that the resource injection stuff is ignored and can cause other problems when using EJBs. I think the only way you can access an EJB is to lookup it up in as you would do in an external app. I'm not sure if the calls are optimised because they are internal, but they may be. You also notice that the EJB container isn't available until the Ready_Event as well.

Simply create an InitialContext and do a lookup for the full classname of your bean, casting the result to the Remote Interface of your bean.

This would apply to the JPA stuff as well, but i've not needed to use that before.
[Message sent by forum member 'jsl123' (jsl123)]

http://forums.java.net/jive/thread.jspa?messageID=233675