13 Replies Latest reply on Jul 8, 2011 3:22 PM by zohar_melamed

    NPE when invoke listMessageCounterAsHTML on JMS queue mbean

    jeremystone

      With HornetQ 2.2.5 we get the following stack trace when invoking listMessageCounterAsHTML on the module=JMS,name="<some_queue_name>",type=Queue mbean:

       

      java.lang.NullPointerException

      at org.hornetq.core.messagecounter.MessageCounter.getMessageCount(MessageCounter.java:205)

      at org.hornetq.core.messagecounter.impl.MessageCounterHelper.listMessageCounterAsHTML(MessageCounterHelper.java:99)

      at org.hornetq.jms.management.impl.JMSQueueControlImpl.listMessageCounterAsHTML(JMSQueueControlImpl.java:341)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      ..etc

       

      Looks like the MessageCounter serverQueue field is null, (this is set null as a result of a null return value from HornetQServerImpl.createQueue(...)).

       

      Using the listMessageCounterAsHTML on the corresponding core mbean address="<address_name>",module=Core,name="<name>",type=Queue does not NPE. However when message counters are enabled, the MessageCounter.onTimer() call throws NPE (because of the null serverQueues, above) resulting in the MessageCountersPinger scheduled task exiting after its first attempted execution and never executing again (as per ScheduledExecutorService scheduleAtFixedRate contract).

       

      This used to be OK with HornetQ 2.2.2.

       

      Has anyone else seen this?