ActiveMQ
  1. ActiveMQ
  2. AMQ-1994

NullPointerException in ActiveMQMessageConsumer#acknowledge(ActiveMQMessage) on acknowledgment.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.1.0
    • Fix Version/s: NEEDS_REVIEW
    • Component/s: JMS client
    • Labels:
      None
    • Environment:

      Windows Terminal Server 2003 / Intel x86 based

      Description

      Hi Folks!

      We have a problem on acknowledge message with an ActiveMQ 5 Server. We are using AqtiveMQ for multi-threaded message processing. On a few Threads we continuously receiving messages, add them to a BlockingQueue and processing them with a another thread reading on the Queue. After processing is done, the message is acknowledged. We using durable consumers to make sure that we won't miss a message on a failure.

      We sometimes (one time in 2-3 weeks) receive the following exception on acknowledging a message (decision dept is name of the RCP application):

      2008-10-28 08:20:21,215 WARN [main] org.csstudio.nams.application.department.decision.DecisionDepartmentActivator: unable to acknowledge message: Alarmnachricht: JMS-Message: ActiveMQMapMessage

      {commandId = 401366, responseRequired = true, messageId = ID:krynfsb-52783-1224106527774-1:0:1:133789:1, originalDestination = null, originalTransactionId = null, producerId = ID:krynfsb-52783-1224106527774-1:0:1:133789, destination = topic://ALARM, transactionId = null, expiration = 1225182021162, timestamp = 1225178421162, arrival = 0, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@10c7e04, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false}

      ActiveMQMapMessage{ theTable =

      { ... }

      }
      org.csstudio.nams.service.messaging.exceptions.MessagingException: acknowledge failed
      at org.csstudio.nams.service.messaging.declaration.DefaultNAMSMessage.acknowledge(DefaultNAMSMessage.java:51)
      at org.csstudio.nams.application.department.decision.DecisionDepartmentActivator.receiveMessagesUntilApplicationQuits(DecisionDepartmentActivator.java:878)
      at org.csstudio.nams.application.department.decision.DecisionDepartmentActivator.performNormalWork(DecisionDepartmentActivator.java:489)
      at org.csstudio.nams.application.department.decision.DecisionDepartmentActivator.start(DecisionDepartmentActivator.java:404)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
      Caused by: javax.jms.JMSException: java.lang.NullPointerException
      at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:46)
      at org.apache.activemq.command.ActiveMQMessage.acknowledge(ActiveMQMessage.java:99)
      at org.csstudio.nams.service.messaging.impl.jms.JMSConsumer$1.acknowledge(JMSConsumer.java:211)
      at org.csstudio.nams.service.messaging.declaration.DefaultNAMSMessage.acknowledge(DefaultNAMSMessage.java:49)
      ... 15 more
      Caused by: java.lang.NullPointerException
      at java.util.LinkedList.clear(Unknown Source)
      at org.apache.activemq.ActiveMQMessageConsumer.acknowledge(ActiveMQMessageConsumer.java:761)
      at org.apache.activemq.ActiveMQSession.acknowledge(ActiveMQSession.java:1383)
      at org.apache.activemq.ActiveMQMessageConsumer$1.execute(ActiveMQMessageConsumer.java:445)
      at org.apache.activemq.command.ActiveMQMessage.acknowledge(ActiveMQMessage.java:95)
      ... 17 more

      Up from this time, we always get the following trace on receiving:

      2008-10-28 08:20:37,808 FATAL JMSConsumer#WorkThread-1 org.csstudio.nams.service.messaging.impl.jms.JMSConsumer$WorkThread: Unexpected exception during recieving message from jms
      java.lang.NullPointerException
      at java.util.LinkedList.addBefore(Unknown Source)
      at java.util.LinkedList.addFirst(Unknown Source)
      at org.apache.activemq.ActiveMQMessageConsumer.beforeMessageIsConsumed(ActiveMQMessageConsumer.java:649)
      at org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:429)
      at org.csstudio.nams.service.messaging.impl.jms.JMSConsumer$WorkThread.run(JMSConsumer.java:85)

      Do you know this problem? Do you have some ideas what happens?

      Thanks,
      Gösta and Matthias

        Activity

        Hide
        Timothy Bish added a comment -

        No way to reproduce this, user never responded to call for testing on newer version. Marking as closed.

        Show
        Timothy Bish added a comment - No way to reproduce this, user never responded to call for testing on newer version. Marking as closed.
        Hide
        Gary Tully added a comment -

        I just had a peek at trunk and access to deliveredMessages is properly synchronised. There have been some changes in this area s the line numbers from your stack trace and trunk are off by a margin.

        I suspect that this issue is resolved for the upcoming 5.2 release.
        It may be worth trying a current 5.3-SNAPSHOT or the RC2 candidate 5.2 release
        You can get the binary distributions here:
        http://people.apache.org/~gtully/staging-repos/activemq-5.2.0/org/apache/activemq/apache-activemq/5.2.0

        Show
        Gary Tully added a comment - I just had a peek at trunk and access to deliveredMessages is properly synchronised. There have been some changes in this area s the line numbers from your stack trace and trunk are off by a margin. I suspect that this issue is resolved for the upcoming 5.2 release. It may be worth trying a current 5.3-SNAPSHOT or the RC2 candidate 5.2 release You can get the binary distributions here: http://people.apache.org/~gtully/staging-repos/activemq-5.2.0/org/apache/activemq/apache-activemq/5.2.0

          People

          • Assignee:
            Unassigned
            Reporter:
            MZ
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development