You must call the EJB service from the servlet context listener method contextInitialized() . The application runs on JBOSS, although the context listener is working fine, I cannot access the EJB bean through JNDI lookup.
Since web deployment in JBOSS happens before the EJB beans are associated with the JNDI tree. How to overcome this? Is there a way to configure a JNDI connection earlier or start a web deployment later when the EJBs are fully deployed?
I sent Thread.sleep() before calling the service in the contextInitialized() method, it works fine in my JBoss5.1.0 GA, and the same doesn't work on other JBoss machines of the same version.
Applications need this because we want to download some basic data from the database and make it available in the web layer (type of caching). Does JBOSS startupmbean meet this requirement? If so, how can I make the data available to the web layer?
Also, if there are alternative ways, please suggest.
source share