How to control the initialization order of an EAR's subdeployments / modules in JBoss Enterprise Application

Solution Verified - Updated -

Issue

  • How to control the initialization order of an EAR's subdeployments / modules in JBoss EAP?
  • Is there a way to maintain the deployment order mentioned in the application.xml file in JBoss EAP?
  • While trying to deploy 2 ejb jars in one EAR on JBoss EAP following kind of exception is observed. Where the EJB jar1 is dependent on EJB jar2.
16:19:26,326 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"EAR_1.ear\".\"EJBOne.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"EAR_1.ear\".\"EJBOne.jar\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment \"EJBOne.jar\" of deployment \"EAR_1.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014183: Bean class test.ejb.one.TestClass specifies @Local annotation, but does not implement 1 interface"},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.EAR_1.testEJBTwo.FormatMapperSE.ValidatorFactory Missing[jboss.naming.context.java.comp.EAR_1.testEJBTwo.FormatMapperSE]","jboss.naming.context.java.comp.EAR_1.common.ejb.ValidatorFactory Missing[jboss.naming.context.java.comp.EAR_1.testEJBTwo.OnlineRequestSI]","jboss.naming.context.java.comp.EAR_1.testEJBTwo.TestBranch.ValidatorFactory Missing[jboss.naming.context.java.comp.EAR_1.testEJBTwo.TestBranch]","jboss.deployment.subunit.\"EAR_1.ear\".\"TestWebApp.war\".INSTALL 
  • The same application worked when all the EJB jar1 and EJB jar2 contains are merged into one JAR and then placed inside an EAR.
  • Unable to deploy an EAR with 2 ejb modules where one is dependent on other .

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content