[jboss-user] [Management, JMX/JBoss] - Re: how to get mbean to deploy after ejb is bound
mazz@jboss.com
do-not-reply at jboss.com
Tue May 1 08:23:56 EDT 2007
I've had to do this very thing in my app. The easist thing to do is:
1) In your MBean, do not do anything that requires the EJBs in your start() method (that is, do not expect the EJBs to be deployed when your MBean is deployed).
2) Create a "reallyStartNow" method in your MBean - this is when it can perform its startup routines that require the EJBs to be deployed
3) if you don't already have a war in your ear, create one
4) create a StartupServlet and make sure it is loaded at startup (defined in web.xml appropriately)
5) in your StartupServlet's init() method, use JMX to find your MBean and invoke the "reallyStartNow" method.
MBeans are deployed first, then EJBs within your EAR, then Webapps within your EAR are started last. So, your init() method is called at a point in time when you know everything else is ready.
This works perfectly for me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042058#4042058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042058
More information about the jboss-user
mailing list