Unable to deploy an EAR when declaring a dependency on a EJB3 module

Solution Verified - Updated -

Issue

I have an application that contains an EJB3 module and a Bean. I want to declare a dependency of the Bean on the EJB module to guarantee that the EJB is already deployed when the start method of the Bean is invoked.

ie.

<bean name="MyListener" class="test.MyListener">                
        <depends>             
              jboss.j2ee:service=EJB3,ear=myEJB3App.ear,jar=EJB3Proj1.jar
        </depends>      
    </bean>    

But the deployment fails with this error

DEPLOYMENTS IN ERROR:
  Deployment "vfszip:/home/user/jbossEAP5.1.2/jbossas/server/default/deploy/myEJB3App.ear
/" is in error due to the following reason(s): org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of
incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "MyListener" is missing the following dependencies:
    Dependency "
                      jboss.j2ee:service=EJB3,ear=myEJB3App.ear,jar=EJB3Proj1.jar
                " (should be in state "Create", but is actually in state "** NOT FOUND Depends on '
                      jboss.j2ee:service=EJB3,ear=myEJB3App.ear,jar=EJB3Proj1.jar
                ' **")

Yet the server.log shows myEJB3App.ear is deployed and started.

Environment

JBoss Enterprise Application Platform 5.1.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.