title: Exception when deploying EJB 3 MDB in Glassfish3
body: <p>Screenshots from Glassfish Web Admin:</p>
  
  <p><img src="https://i.stack.imgur.com/1Y0cG.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/W0zap.jpg" alt="enter image description here"></p>
  
  <p>With the factory and Queue are injected, the code deploys OK:</p>
  
  <pre><code>@Resource(name = "jmsQueueConnectionFactory", mappedName = "connectionFactory")
  private ConnectionFactory connectionFactory;
  
  @Resource(name = "jmsDvdQueue", mappedName = "dvdQueue")
  private Destination destination;
  </code></pre>
  
  <p>But when I add a MDB that looks like this:</p>
  
  <pre><code>@MessageDriven(name = "Consumer",
          activationConfig = {
                  @ActivationConfigProperty(
                          propertyName = "destinationType",
                          propertyValue = "javax.jms.Queue"
                  ),
                  @ActivationConfigProperty(
                          propertyName = "destination",
                          propertyValue = "jmsDvdQueue"
                  ),
                  @ActivationConfigProperty(
                          propertyName = "connectionFactoryJndiName",
                          propertyValue = "jmsQueueConnectionFactory"
                  )
          })
  public class QueueConsumer implements MessageListener {
      @Inject
      private UserBean userBean;
  
      @Override
      public void onMessage(Message message) {
          ObjectMessage objectMessage = (ObjectMessage) message;
          try {
              Dvd dvd = (Dvd) ((ObjectMessage) message).getObject();
              System.out.println(dvd);
          } catch (JMSException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>it would not deploy; the server logs say:</p>
  
  <pre><code>[#|2012-11-06T16:19:49.290+0200|SEVERE|glassfish3.1.2|javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system|_ThreadID=22;_ThreadName=Thread-2;|Missing Destination JNDI Name|#]
  
  [#|2012-11-06T16:19:49.290+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.container.ejb.mdb.com.sun.ejb.containers|_ThreadID=22;_ThreadName=Thread-2;|MDB00017: [Consumer]: Exception in creating message-driven bean container: [com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Error in Runtime DD: missing destination JNDI name]|#]
  
  [#|2012-11-06T16:19:49.291+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.container.ejb.mdb.com.sun.ejb.containers|_ThreadID=22;_ThreadName=Thread-2;|com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
  com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Error in Runtime DD: missing destination JNDI name
      at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1872)
      at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:186)
      at com.sun.ejb.containers.MessageBeanContainer.&lt;init&gt;(MessageBeanContainer.java:205)
      at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:121)
      at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
      at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:299)
      at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:105)
      at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
      at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662)
  |#]
  </code></pre>