Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-2679

"VMTransport" NullPointerException from ActiveMQSessionExecutor.wakeup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.2
    • 5.6.0
    • None
    • AMQ 4.1.2 embedded in Geronimo 2.1.3, SuSE Linux 11

    Description

      setup in Geronimo deployment plan with

      <config-property-setting name="ServerUrl">vm://localhost?async=true&jms.asyncDispatch=false&jms.copyMessageOnSend=false&jms.watchTopicAdvisories=false</config-property-setting>

      I use only JMS send/reply pattern:

      connection = factory.createQueueConnection();
      connection.start();
      session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      sender = session.createSender(requestQueue);
      replyQueue = session.createTemporaryQueue();
      jmsRequestMessage = session.createTextMessage();
      sender.send(jmsRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
      receiver = session.createReceiver(replyQueue);
      jmsReplyMessage = receiver.receive();
      connection.close();

      When the message traffic get huge (or the server is under intensive computing), I would got such NPE

      Exception in thread "VMTransport" java.lang.NullPointerException
      at org.apache.activemq.ActiveMQSessionExecutor.wakeup(ActiveMQSessionExecutor.java:76)
      at org.apache.activemq.ActiveMQSessionExecutor.execute(ActiveMQSessionExecutor.java:61)
      at org.apache.activemq.ActiveMQSession.dispatch(ActiveMQSession.java:1344)
      at org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1485)
      at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:95)
      at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
      at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:201)
      at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:120)
      at org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunner.java:26)
      at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
      at java.lang.Thread.run(Thread.java:619)

      setting jms.asyncDispatch=false may ease the problem, but the NPE still happens..

      as comment from kevan http://n3.nabble.com/sudden-NullPointerException-from-ActiveMQSessionExecutor-wakeup-tt676485.html#a676966
      It could be a timing hole in ActiveMQSessionExecutor.
      possible fix from kevan

      Index: activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java
      ===================================================================
      — activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java (revision 663068)
      +++ activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java (working copy)
      @@ -118,10 +118,14 @@
      try {
      if (messageQueue.isRunning()) {
      messageQueue.stop();

      • if (taskRunner != null) {
      • taskRunner.shutdown();
      • taskRunner = null;
        + TaskRunner tempTaskRunner;
        + synchronized (this)
        Unknown macro: { + tempTaskRunner = this.taskRunner; + this.taskRunner = null; }


        + if (tempTaskRunner != null)

        Unknown macro: { + tempTaskRunner.shutdown(); + }


        }
        } catch (InterruptedException e) {
        Thread.currentThread().interrupt();

      Attachments

        Activity

          People

            Unassigned Unassigned
            easyl TH L.
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: