I have 2 solutions for you :
- you can easily extend the JBoss DeploymentSorter. Then declare the new class in jboss-service.xml in URLComparator.
- you can define dependencies between jmx names. You can say for example that the war needs an ejb or an ear or a sar. There is only one limitation : you can't define a dependency deployement for an ear. But you can set a jmx-name so that others can depends on this ear.
Example : in you war's jboss-web.xml, you can set
In this case, you war won't deploy until OwnService is deployed.
I need to solve this problem also.
and i want to use your second solutions.
I add this to jboss-web.xml, but it doesn't work. could you please describe it in details. thanks a lot.
In your ear, in META_INF/jboss-app.xml :
<jboss-app> <jmx-name>myservice:service=OwnService</jmx-name> </jboss-app>
In your war, in META-INF/jboss-web.xml:
<jboss-web> <depends>myservice:service=OwnService</depends> </jboss-web>
this way, your war will deploy after your ear is deployed. But keep in mind that the ear depends on the war is not possible. The deployment of the ear can not depend on other services (but services in the ear can).
Hope it will help you.
I have a similar problem, I'm trying to get a Quartz MBean setup and get it to deploy AFTER my ear application (the Jobs classes are included in my ear file).
How could I do this?
Using this dependency does not work
As it seems to be completed before the app is actually deployed.
I even tried 3 dependencies:
<depends>jboss.ejb:service=EJBDeployer</depends> <depends>jboss.jca:service=DataSourceBinding,name=QuartzDS</depends> <depends>jboss.j2ee:service=EARDeployer</depends>
But same problem, it looks like Quartz is launched before the ear is fully deployed...
Any pointer/solution would be greatly appreciated.