1 Reply Latest reply on Sep 16, 2015 6:50 PM by onstottj

    How to control order of deployment (EJB first and then MBeans deployment) in Wildfly 8.2.0 AS

    sridharthiyagarajan

      Hello,

       

      I am migrating an EAR application containing MBeans from JBoss 6 AS to Wildfly 8.2.0 AS. In my EAR application, MBeans depend on EJB before initialization.

       

      In JBoss 6 AS, @DependsOn annotation used in MBean maintained the sequence of the deployment i.e. Dependent EJB gets deployed and then, MBean gets deployed.

       

      In Wildfly 8.2.0, I am trying to implement the same and @DependsOn is not working.

       

      I tried the below in jboss-service.xml to have MBeans deployed only after the deployment of EAR file but this did not happen.

       

      <mbean code="sample.HelloWorldService" name="sample:service=HelloWorld,id=1">

          <depends>jboss.j2ee:service=EARDeployment,url='application.ear'</depends>

      </mbean>

       

      I got same error for almost all the trial and error method I did using jboss-service.xml. It fails mentioning .create is missing .start is missing for whatever possible alternatives I have added in <depends> tag above.

       

      1. Should an MBean depend only on MBean that has proper MBean implementation i.e. extending ServiceMBeanSupport and implemented with life cycle methods ?

       

      I also tried @startup in EJB as it is a SINGLETON STATELESS EJB but I cannot control the sequence i.e. 1. EJB deployment 2. MBeans deployment.

       

      2. Can anyone please help about how to control the order of deployment in Wildfly 8.2.0. I need to deploy EJB first and then MBeans.

       

      Many thanks.