jbossas/jboss-as — pull request #4367 by jmesnil (2013-04-11 13:25:02+00:00)
Title: [AS7-6873] NPE when calling a runtime operation on non-existing resource

before executing the runtime step, call
context.readResource(EMPTY_ADDRESS, false) to ensure that there is a
resource. If that's not the case, the operation will fail with a
descriptive message instead of reporting an exception later on (such as
a NPE)

The issue is about a messaging resource but the problem is more general.
I don't think it should be possible to execute a runtime operation on a resource that does not exist. Is there a counter-example?
context.readResource(EMPTY_ADDRESS, false) looked like the simplest way to ensure that the resource exists at the given operation address...