I created a sar file with a META-INF/jboss-service.xml and deployed it by moving it to jboss/deploy. Worked flawlessly and I no longer have classloader problems like I did with 2.4.4. My MBean actually ran fine - so far so good. Excellent job with classloaders!
However, when restarting the application server it insists on starting mine first, which uses JMS and tries to connect to some EJBs that are not available yet. I feel flattered, but it doesn't work :-)
I want to avoid human intervention as much as possible, so I don't really want to use the user-service.xml inside the deploy directory if I can help it (although I'm sure that would fix it). Autodeploying ejbs has worked so well in JBoss 2 on our production systems I want to do the same with mbeans...
I saw some of the existing services in the deploy directory had a <depends optional-attribute-name.../> tag. I took one pretty verbatim that depends on "JBossMQService" with value of jboss.mq:service=Server. But when deploying this one (jboss running or not), the error is
javax.management.AttributeNotFoundException: JBossMQService not accessible.
But really my dream is just for my sarfile to be started at the end, hopefully without any changes to the stock jboss installation.
Any help with this is appreciated.
Use a depends
The <depends optional-attribute-name> is for specifying
the dependency and setting an attribute to remember
the object name.
For EJB dependencies, you have two options.
There is an EjbModule or a JSR77 MBean.
Some of this has changed recently, I can't remember
what level of ejb support is in which version.