Announcement Announcement Module
Collapse
No announcement yet.
Testing an implementation of AbstractJmsMessageDrivenBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Testing an implementation of AbstractJmsMessageDrivenBean

    Hi,

    I'm using a MDB which extends AbstractJmsMessageDrivenBean. I need to write a unit test for receiving a message from a configured queue. I've configured activemq as the messaging provider and use jmsTemplate to send a message, however, i'm unable to configure the MDB correctly. When I run the test, the MDB tries to initialize itself and list on the queue, however, I get the following exception.


    Code:
    16:02:45 WARN  org.springframework.jms.listener.DefaultMessageListenerContainer - Execution of JMS message listener failed
    java.lang.NullPointerException
    	at org.springframework.ejb.support.AbstractEnterpriseBean.getBeanFactory(AbstractEnterpriseBean.java:147)
    	at com.test.ejb.MyMDB.onMessage(MyMDB.java:40)

    I think the problem is with how I configure the BeanFactoryLocator and the BeanFactoryLocatorKey. Anyone have an example of how they can be mocked in spring configuration needed for the MDB to startup and listen on a queue.

    Thanks
Working...
X