title: Deploy MDB with EJB 3 and JBoss AS 6
body: <p>I'm a newbie about EJB 3 and I'd like deploy as simple EAR, which uses a MDB, on JBoss AS 6.
  But, when I deploy my ear the following exception occurs:</p>
  
  <pre><code>16:53:37,500 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=OrderBillingMDB,service=EJB3 state=Create: org.jboss.deployers.spi.DeploymentException: Required config property RequiredConfigPropertyMetaData@fcb25d[name=destination descriptions=[DescriptionMetaData@b17e9f[language=it]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(destinationType=javax.jms.Queue), ActivationConfigProperty(destinationName=queue/OrderBillingQueue)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar'
  at org.jboss.resource.deployment.ActivationSpecFactory.createActivationSpec(ActivationSpecFactory.java:95) [:6.0.0.Final]
  at org.jboss.resource.deployers.RARDeployment.createActivationSpec(RARDeployment.java:313) [:6.0.0.Final]
  at org.jboss.resource.deployers.RARDeployment.internalInvoke(RARDeployment.java:276) [:6.0.0.Final]
  at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:153) [:6.0.0.Final (Build SVNTag:JBoss_6.0.0.Final date: 20101228)]
  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) [:6.0.0.GA]
  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]
  at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:58) [:1.7.17]
  at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.createActivationSpec(JBossMessageEndpointFactory.java:322) [:1.7.17]
  at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.start(JBossMessageEndpointFactory.java:207) [:1.7.17]
  at org.jboss.ejb3.mdb.MessagingContainer.startProxies(MessagingContainer.java:248) [:1.7.17]
  at org.jboss.ejb3.mdb.MessagingContainer.lockedStart(MessagingContainer.java:201) [:1.7.17]
  at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:1105) [:1.7.17]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.7.0]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0]
  at java.lang.reflect.Method.invoke(Method.java:601) [:1.7.0]
  at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
  at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
  at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
  at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
  at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
  at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
  at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
  at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
  at org.jboss.profileservice.plugins.deploy.actions.DeploymentStartAction.doPrepare(DeploymentStartAction.java:98) [:0.2.2]
  at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:101) [:0.2.2]
  at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
  at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
  at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
  at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
  at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.startDeployments(AbstractDeployHandler.java:168) [:0.2.2]
  at org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.startDeployments(DeployHandlerDelegate.java:74) [:6.0.0.Final]
  at org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(DeployHandler.java:156) [:6.0.0.Final]
  at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898) [:6.0.0.Final]
  at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791) [:6.0.0.Final]
  at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744) [:6.0.0.Final]
  at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548) [:6.0.0.Final]
  at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234) [:6.0.0.Final]
  
  16:53:37,531 INFO  [org.jboss.ejb3.session.SessionSpecContainer] Stopping jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceOrderBean,service=EJB3
  16:53:37,546 INFO  [org.jboss.ejb3.EJBContainer] STOPPED EJB: bean.ejb3inaction.example.buslogic.PlaceOrderBean ejbName: PlaceOrderBean
  16:53:37,546 WARN  [org.jboss.profileservice.management.upload.remoting.DeployHandler] Failed to complete command: [start] for deployment: names=[chapter2.ear]: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
  
  DEPLOYMENTS MISSING DEPENDENCIES:
    Deployment "jboss-switchboard:appName=chapter2,module=chapter2-war" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceBid,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")
      Dependency "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceOrderBean,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")
    Deployment "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceBid,service=EJB3" is missing the following dependencies:
      Dependency "org.jboss.ejb.bean.instantiator/chapter2/chapter2-ejb/PlaceBid" (should be in state "Installed", but is actually in state "Instantiated")
    Deployment "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceBid,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceBid,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")
    Deployment "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceOrderBean,service=EJB3" is missing the following dependencies:
      Dependency "org.jboss.ejb.bean.instantiator/chapter2/chapter2-ejb/PlaceOrderBean" (should be in state "Installed", but is actually in state "Instantiated")
    Deployment "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceOrderBean,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=PlaceOrderBean,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")
    Deployment "jboss.web.deployment:war=/chapter2-war" is missing the following dependencies:
      Dependency "vfs:///D:/jboss6/server/default/deploy/chapter2.ear_WeldBootstrapBean" (should be in state "Start", but is actually in state "Create")
      Dependency "jboss-switchboard:appName=chapter2,module=chapter2-war" (should be in state "Installed", but is actually in state "Deploy")
    Deployment "vfs:///D:/jboss6/server/default/deploy/chapter2.ear_WeldBootstrapBean" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=OrderBillingMDB,service=EJB3" (should be in state "PreInstall", but is actually in state "**ERROR**")
  
  DEPLOYMENTS IN ERROR:
    Deployment "org.jboss.ejb.bean.instantiator/chapter2/chapter2-ejb/PlaceOrderBean" is in error due to the following reason(s): Instantiated
    Deployment "org.jboss.ejb.bean.instantiator/chapter2/chapter2-ejb/PlaceBid" is in error due to the following reason(s): Instantiated
    Deployment "jboss.j2ee:ear=chapter2.ear,jar=chapter2-ejb.jar,name=OrderBillingMDB,service=EJB3" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: Required config property RequiredConfigPropertyMetaData@fcb25d[name=destination descriptions=[DescriptionMetaData@b17e9f[language=it]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(destinationType=javax.jms.Queue), ActivationConfigProperty(destinationName=queue/OrderBillingQueue)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar', **ERROR**
  
      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
      at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
      at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
      at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
      at org.jboss.profileservice.plugins.deploy.actions.DeploymentStartAction.doPrepare(DeploymentStartAction.java:104) [:0.2.2]
      at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:101) [:0.2.2]
      at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
      at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
      at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
      at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
      at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.startDeployments(AbstractDeployHandler.java:168) [:0.2.2]
      at org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.startDeployments(DeployHandlerDelegate.java:74) [:6.0.0.Final]
      at org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(DeployHandler.java:156) [:6.0.0.Final]
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898) [:6.0.0.Final]
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791) [:6.0.0.Final]
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744) [:6.0.0.Final]
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548) [:6.0.0.Final]
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234) [:6.0.0.Final]
  </code></pre>
  
  <p>My code is the following:</p>
  
  <pre><code>package bean.ejb3inaction.example.buslogic;
  
  import javax.ejb.ActivationConfigProperty;
  import javax.ejb.MessageDriven;
  import javax.jms.Message;
  import javax.jms.MessageListener;
  import javax.jms.ObjectMessage;
  
  @MessageDriven(activationConfig = {
          @ActivationConfigProperty(propertyName="destinationName", propertyValue="jms/OrderBillingQueue"),
          @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue")
          },mappedName = "jms/OrderBillingQueue"
  )
  
  public class OrderBillingMDB implements MessageListener {
      public void onMessage(Message message) {
          try {
  
              ObjectMessage objectMessage = (ObjectMessage) message;
              Order order = (Order) objectMessage.getObject();
  
              try {
                  bill(order);
                  notifyBillingSuccess(order);
                  order.setStatus(OrderStatus.COMPLETE);
              } catch (BillingException be) {
                  notifyBillingFailure(be, order);
                  order.setStatus(OrderStatus.BILLING_FAILED);
              } finally {
                  update(order);
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
  
      }
  
      /* OTHER METHODS */
  }
  </code></pre>
  
  <p>and my *-hornetq-jms.xml is the following:</p>
  
  <pre><code>    &lt;configuration xmlns="urn:hornetq"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd"&gt;
  
      &lt;queue name="queue/OrderBillingQueue"&gt;  
        &lt;entry name="jms/OrderBillingQueue" /&gt; 
  &lt;/queue&gt;  
  &lt;queue name="queue/ShippingRequestQueue"&gt;  
        &lt;entry name="jms/ShippingRequestQueue" /&gt; 
  &lt;/queue&gt;  
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Any help to solve my problem is appreciated.
  Thanks in advance</p>