I've read about 10 pages back in the forums list, so hopefully I'm not asking something completely obvious.
I've just created my first MBeans (yay), and they are handy, but I need for them to be started _after_ my EJBs deploy, and preferably after the WAR deploys.
(My application consists of one EAR that contains a SAR, an EJB JAR, and a WAR)
I read in a previous thread that you could not create a dependency in jboss-service.xml on an EJB or WAR deployment.
javajedi previously wrote:
I seem to have a working solution, although it's nowhere near as elegant as I had hoped. I removed the dependency declarations from my service XML. Then in my MBean's start() method, I manually added a notification listener for jboss.ejb:service=EJBDeployer. Finally, I actually perform my startup call to the EJB inside handleNotification(). I would still much prefer to handle this dependency declaratively, as I think the JBoss authors intended, rather than programatically. However, it seems that the fact that the EJBs are sending out notifications that they are started before they're actually ready to use, from a CMP perspective, prevents this. This seems like busted behavior to me. Does anyone have any further thoughts on this? Should I file a bug?
For JBoss 3.2.1., would this be the recommended solution? I would rather not upgrade JBoss right now, as everything is working perfectly and we are getting ready to release a version of our product, so upgrading JBoss now would not give us enough time to run tests on everything.
Uncomment the prefix deployment sorter from your conf/jboss-service.xml and order your deployments by number. This is by far the easiest way to order deployments.