1 Reply Latest reply on Apr 19, 2005 11:15 AM by Scott Stark

    NullPointerException while using Singleton MDB as Consumer

    Ranjith Krishnan Newbie

      I am using a Singleton MDB as the consumer for a queue. It works fine when there are limited no. of messages. But when the no. of messages > 100 there is a NullPointer Exception thrown and rest of the messages are not consumed.

      Also this problem occured in jboss-4.0.1sp1 only. It works perfectly with 3.2.5

      I have given the trace below:

      2005-04-19 15:36:42,501 WARN org.jboss.mq.SpyConnectionConsumer - Connection consumer closing due to error in listening thread SpyConnectionConsumer[sub=Subscription[subId=-2147483648connection=ConnectionToken:ID:3/e89fc04887ea0ab1c289465dc78f6594 destination=QUEUE.TASK_INBOUND_QUEUE messageSelector=null Local Create] messages=0 waitingForMessage=false internalThread=Thread[Connection Consumer for dest Subscription[subId=-2147483648connection=ConnectionToken:ID:3/e89fc04887ea0ab1c289465dc78f6594 destination=QUEUE.TASK_INBOUND_QUEUE messageSelector=null Local Create] id=2,5,jboss] sessionPool=org.jboss.jms.asf.StdServerSessionPool@da7b85 connection=Connection@30158658[token=ConnectionToken:ID:3/e89fc04887ea0ab1c289465dc78f6594 rcvstate=STARTED]]
      org.jboss.mq.SpyJMSException: Cannot receive ; - nested throwable: (java.lang.NullPointerException)
      at org.jboss.mq.Connection.receive(Connection.java:968)
      at org.jboss.mq.SpyConnectionConsumer.run(SpyConnectionConsumer.java:238)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.lang.NullPointerException
      at org.jboss.mq.pm.jdbc3.PersistenceManager.loadFromStorage(PersistenceManager.java:850)
      at org.jboss.mq.server.MessageCache.loadFromStorage(MessageCache.java:411)
      at org.jboss.mq.server.MessageReference.makeHard(MessageReference.java:351)
      at org.jboss.mq.server.MessageReference.getMessage(MessageReference.java:156)
      at org.jboss.mq.server.BasicQueue.setupMessageAcknowledgement(BasicQueue.java:881)
      at org.jboss.mq.server.BasicQueue.receive(BasicQueue.java:488)
      at org.jboss.mq.server.JMSQueue.receive(JMSQueue.java:136)
      at org.jboss.mq.server.ClientConsumer.receive(ClientConsumer.java:222)
      at org.jboss.mq.server.JMSDestinationManager.receive(JMSDestinationManager.java:673)
      at org.jboss.mq.server.JMSServerInterceptorSupport.receive(JMSServerInterceptorSupport.java:226)
      at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurityInterceptor.java:100)
      at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.java:570)
      at org.jboss.mq.server.JMSServerInvoker.receive(JMSServerInvoker.java:226)
      at org.jboss.mq.il.jvm.JVMServerIL.receive(JVMServerIL.java:244)
      at org.jboss.mq.Connection.receive(Connection.java:957)
      ... 2 more