EJBs seem to be loaded lazily – whenever accessed.
However, I want to initialize them eagerly – i.e. whenever the container starts-up. How is this achieved (in JBoss in particular)
This topic gives some hints, but isn’t quite satisfactory.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As of EJB 3.1, singleton beans can be notified of module start and stop:
Prior to EJB 3.1, there is no standard, EJB-only solution. I’d suggest adding a WAR to your EAR and using a servlet-context-listener.