Announcement Announcement Module
Collapse
No announcement yet.
Nullpointer configuring DefaultMessageListenerContainer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nullpointer configuring DefaultMessageListenerContainer

    2008-10-20 13:00:56,312 [WorkManager.DefaultWorkManager : 1] ERROR org.springframework.jms.listener.DefaultMessageLis tenerContainer - Setup of JMS message listener invoker failed - trying to recover
    java.lang.NullPointerException
    at com.ibm.ejs.jms.JMSMessageConsumerHandle.enlist(JM SMessageConsumerHandle.java:764)
    at com.ibm.ejs.jms.JMSMessageConsumerHandle.receive(J MSMessageConsumerHandle.java:499)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.receiveMessage(AbstractPoll ingMessageListenerContainer.java:375)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.doReceiveAndExecute(Abstrac tPollingMessageListenerContainer.java:300)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.receiveAndExecute(AbstractP ollingMessageListenerContainer.java:254)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.invokeL istener(DefaultMessageListenerContainer.java:870)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.run(Def aultMessageListenerContainer.java:817)
    at org.springframework.scheduling.commonj.DelegatingW ork.run(DelegatingWork.java:61)
    at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext .java:1030)
    at com.ibm.ws.asynchbeans.WorkWithExecutionContextImp l.go(WorkWithExecutionContextImpl.java:195)
    at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkIt emImpl.java:187)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1462)


    Here is my Spring Configuartion - Any Pointer or help is greatly Appreciated
    (I am on Spring 2.0.8 and Websphere 6.0.2 +)

    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName">
    <value>jms/efpQCF</value>
    </property>
    </bean>

    <bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination .JndiDestinationResolver">
    <property name="cache">
    <value>true</value>
    </property>
    </bean>


    <bean id="listenerTaskExecutor" class="org.springframework.scheduling.commonj.Work ManagerTaskExecutor">
    <property name="workManagerName" value="wm/default"/>
    </bean>

    <bean id="mxContractStatusListener" class="com.dcs.mcass.mq.listener.MXContractStatusL istener" />

    <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destinationName" value="jms/efpMxContractStatusReq" />
    <property name="destinationResolver" ref="jmsDestinationResolver"/>
    <property name="concurrentConsumers" value="1"/>
    <property name="maxConcurrentConsumers" value="1"/>
    <property name="cacheLevel" value="2"/>
    <property name="taskExecutor" ref="listenerTaskExecutor" />
    <property name="sessionTransacted" value="true"/>
    <property name="transactionManager" ref="transactionManager" />
    <property name="messageListener" ref="mxContractStatusListener" />
    </bean>

  • #2
    1. Try to use the latest Spring version (AbstractPollingMessageListenerContainer from 2.5.5 doesn't have receiveMessage() method at the line 375);
    2. Try to create MessageConsumer manually, without any Spring help and check the result. If the NPE still occurs, open the case at WS support;

    Comment


    • #3
      Resolved

      Resolved.Got the clue from
      forum.springframework.org/archive/index.php/t-39605.html

      changing the cacheLevel to zero resolved the problem.
      <property name="cacheLevel" value="0"/>

      Not sure why, Although I use a hibernate TransactionManager. Looks like the cacheLevel would not work with hibernate transaction manager

      <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
      <property name="sessionFactory"><ref bean="sessionFactory"/></property>
      </bean>

      Comment

      Working...
      X