[jboss-jira] [JBoss JIRA] (AS7-6961) NPE when calling a runtime handler on a HornetQ server that just has been activated

Jeff Mesnil (JIRA) jira-events at lists.jboss.org
Fri Apr 19 11:01:56 EDT 2013


Jeff Mesnil created AS7-6961:
--------------------------------

             Summary: NPE when calling a runtime handler on a HornetQ server that just has been activated
                 Key: AS7-6961
                 URL: https://issues.jboss.org/browse/AS7-6961
             Project: Application Server 7
          Issue Type: Bug
          Components: JMS
            Reporter: Jeff Mesnil
            Assignee: Jeff Mesnil
            Priority: Minor


if a hornetq-server has just been activated (a backup server that has just failed over), a client can get a NPE if he calls a runtime operation on the server's children resources:

{noformat}
22:59:18,142 ERROR org.jboss.as.controller.management-operation JBAS014612: Operation ("read-attribute") failed - address: ([
("subsystem" => "messaging"),
("hornetq-server" => "default"),
("queue" => "bb37547c-3d64-4800-be47-3ef0434d1b11")
]): java.lang.NullPointerException
at org.jboss.as.messaging.QueueReadAttributeHandler.executeRuntimeStep(QueueReadAttributeHandler.java:115)
at org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:86) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:439) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:321) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:228) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:223) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:235) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:124) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:148) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.access$300(ModelControllerClientOperationHandler.java:97) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:114) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:296) [jboss-as-protocol-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:518) [jboss-as-protocol-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final.jar:2.1.0.Final]
{noformat}

The NPE happens because the HornetQ server has been activated, yet the resource (in this case a queue) is not available (the queue service is installing and the queue is not deployed by HornetQ).

The operation is ignored if the HornetQ server is not activated[1] but that's not enough. We also have to check whether the QueueService is installed before using the QueueControl. 
There will still be a window of failure but we can report to the user that the runtime resource is not (yet) available instead of a ugly NPE

[1] https://github.com/jbossas/jboss-as/blob/master/messaging/src/main/java/org/jboss/as/messaging/QueueReadAttributeHandler.java#L88


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list