One way to do this is to add a servlet and in it init look up the ejab and call the method. set the load onstartup variable for the servlet. EJB 3.1(The EJB 3.1 specification is not yet final ), there a type of bean called Singleton. Singletons have an @Startup annotation which can be applied to the bean class. When used, the Container will instantiate the Singleton instance eagerly when the application starts up, otherwise the Container will instantiate the Singleton instance lazily when the bean is first accessed.
Main Topics
Browse All Topics





by: Mr_ItPosted on 2009-05-25 at 07:52:57ID: 24466927
Websphere has something called "startup beans". Maybe that will help?
I don't think you can do this in a "standard" way with EJB 3 and without a servlet. In EJB 3.1 you will be able to do this with a Timer on startup, if I'm correct.
Regards