1. How can we get the bean to initialize when JBoss starts up?
As far as i know, there isnt a direct way of doing this.
Have you checked this section in the JBoss guide which mentions about scheduling tasks using JMX http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch10.html#ch10.sched.sect
>> How can we get the bean to initialize when JBoss starts up?
This may be a non-standard means to doing this, but we added a few servlets on our persistence layer to automatically start up and initialize timer tasks. Maybe this could solve your issue?
Thanks for the replies. For the scheduler we ended up using a Service POJO bean which is always a singleton. Then we used our existing web service bean simply as an interface into that. Seems to work!
Did the tutorial work for you?
I created a service as described in the tutorial, but it is throwing an exception when I shutdown jboss.
Then I deployed the tutorial applicatoin from the src url specified in the previous post, and it fails again at jboss shutdown. Here are the exceptions on the jboss console:
2007-08-31 14:17:55,870 WARN [ServiceDelegateWrapper] Stopping failed jboss.j2ee:jar=tutorial.jar,name=ServiceThree,ser
java.lang.RuntimeException: javax.management.InstanceNotFoundException: jboss.j2ee:jar=tutorial.jar,name=ServiceThree,se
rvice=EJB3,type=ManagementInterface is not registered.
2007-08-31 14:17:56,308 WARN [ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:jar=tutorial.
ServiceTwo - Stopping
2007-08-31 14:17:56,308 WARN [ServiceDelegateWrapper] Stopping failed jboss.j2ee:jar=tutorial.jar,name=ServiceTwo,servi
java.lang.RuntimeException: javax.management.InstanceNotFoundException: tutorial:service=serviceTwo is not registered.
followed by same message for ServiceOne.
Is this a known issue?