Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-444

onMessage of MDB causes NullPointerException

XMLWordPrintable

      Unlike with Weld 1.0.0 SP4, I can now deploy my EJB module that has an MDB. However, when onMessage gets called I get the following:

      SEVERE: MDB00050: Message-driven bean [Core_Framework:EmailConsumerBean]: Exception in creating message-driven ejb : [java.lang.NullPointerException]
      SEVERE: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1132)
      at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:138)
      at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1603)
      at com.sun.ejb.containers.MessageBeanContainer.createMessageDrivenEJB(MessageBeanContainer.java:697)
      at com.sun.ejb.containers.MessageBeanContainer.access$100(MessageBeanContainer.java:95)
      at com.sun.ejb.containers.MessageBeanContainer$MessageBeanContextFactory.create(MessageBeanContainer.java:478)
      at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:200)
      at com.sun.ejb.containers.MessageBeanContainer._getContext(MessageBeanContainer.java:542)
      at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2418)
      at com.sun.ejb.containers.MessageBeanContainer.beforeMessageDelivery(MessageBeanContainer.java:979)
      at com.sun.ejb.containers.MessageBeanListenerImpl.beforeMessageDelivery(MessageBeanListenerImpl.java:72)
      at com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:134)
      at $Proxy521.beforeDelivery(Unknown Source)
      at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:245)
      at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:92)
      at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:492)
      at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:528)

      SEVERE: MQRA:OMR:run:Caught Exception from onMessage():Redelivering:Core_Framework:EmailConsumerBean: Message-driven bean invocation closed by container
      SEVERE: MDB00042: [Core_Framework:EmailConsumerBean]: No invocation for message []
      SEVERE: MDB00050: Message-driven bean [Core_Framework:EmailConsumerBean]: Exception in creating message-driven ejb : [java.lang.NullPointerException]
      SEVERE: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1132)
      at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:138)
      at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1603)
      at com.sun.ejb.containers.MessageBeanContainer.createMessageDrivenEJB(MessageBeanContainer.java:697)
      at com.sun.ejb.containers.MessageBeanContainer.access$100(MessageBeanContainer.java:95)
      at com.sun.ejb.containers.MessageBeanContainer$MessageBeanContextFactory.create(MessageBeanContainer.java:478)
      at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:200)
      at com.sun.ejb.containers.MessageBeanContainer._getContext(MessageBeanContainer.java:542)
      at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2418)
      at com.sun.ejb.containers.MessageBeanContainer.beforeMessageDelivery(MessageBeanContainer.java:979)
      at com.sun.ejb.containers.MessageBeanListenerImpl.beforeMessageDelivery(MessageBeanListenerImpl.java:72)
      at com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:134)
      at $Proxy521.beforeDelivery(Unknown Source)
      at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:245)
      at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:92)
      at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:492)
      at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:528)

      SEVERE: MQRA:OMR:run:Caught Exception from onMessage():Redelivering:Core_Framework:EmailConsumerBean: Message-driven bean invocation closed by container
      SEVERE: MQRA:OMR:run:Exhausted redeliveryAttempts-msg=com.sun.messaging.jms.ra.DirectObjectPacket@1656ed6
      SEVERE: MQRA:OMR:run:Exhausted redeliveryAttempts-spec=ActvationSpec configuration=
      DestinationType =javax.jms.Queue
      Destination =EmailQueue
      MessageSelector =null
      AcknowledgeMode =Auto-acknowledge
      SubscriptionDurability =NonDurable
      useSharedSubscriptionInClusteredContainer=true
      ClientId =null
      SubscriptionName =null
      EndpointPoolMaxSize =32
      EndpointPoolSteadySize =0
      EndpointPoolResizeCount =8
      EndpointPoolResizeTimeout =600
      EndpointExceptionRedeliveryAttempts =1
      EndpointExceptionRedeliveryInterval =500
      SendUndeliverableMsgsToDMQ =true
      GroupName =null
      RAUID =null
      InClusteredContainer =false
      MdbName =null
      UserName =null
      EnableRADirect =true
      EnableAPIDirect =false
      AddressList (in effect) =localhost:26703,localhost
      options =null

      SEVERE: MQRA:OMR:run:Message returned & marked for routing to the DMQ
      SEVERE: MQRA:OMR:run:omrId=0:Acked Undeliverable-Msg=com.sun.messaging.jms.ra.DirectObjectPacket@1656ed6
      SEVERE: MDB00042: [Core_Framework:EmailConsumerBean]: No invocation for message []
      WARNING: [MDBContainer] Current thread done cleanup()...

      If I remove the beans.xml, everything works fine.

              pmuiratbleepbleep Pete Muir (Inactive)
              jpleed3_jira John Leed (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: