NPE when trying to remove an EJB subsystem channel-creation-options resource
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.1.x
Issue
- When trying to remove
EJB subsystemthroughCLI, it is givingNullPointerException:
/subsystem=ejb3/service=remote:remove()
The results:
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.NullPointerException",
"rolled-back" => true
}
- In server.log:
ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 4) WFLYCTL0013: Operation ("remove") failed - address: ([
("subsystem" => "ejb3"),
("service" => "remote"),
("channel-creation-options" => "MAX_OUTBOUND_MESSAGES")
]): java.lang.NullPointerException
at org.jboss.as.controller.OperationContextImpl.readResourceFromRoot(OperationContextImpl.java:894)
at org.jboss.as.controller.OperationContextImpl.readResourceFromRoot(OperationContextImpl.java:884)
at org.jboss.as.controller.RestartParentResourceHandlerBase.getModel(RestartParentResourceHandlerBase.java:216)
at org.jboss.as.controller.RestartParentResourceHandlerBase.access$000(RestartParentResourceHandlerBase.java:39)
at org.jboss.as.controller.RestartParentResourceHandlerBase$1.execute(RestartParentResourceHandlerBase.java:66)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:982)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:726)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:450)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1402)
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:418)
at org.jboss.as.controller.ModelControllerImpl.lambda$execute$1(ModelControllerImpl.java:243)
...
Resolution
-
This was the communityContent from issues.jboss.org is not included.bug, for
EAPContent from issues.jboss.org is not included.JIRA is opened to have it fixed inEAP 7.1 CP6 -
The issue has been fixed in upstream, so
EAP 7.2already has it fixed. -
There are two workarounds available for this issue as below:
[1] Put the server in admin-only mode before removing the subsystem.
[standalone@localhost:9990 /] reload --admin-only=true
[standalone@localhost:9990 /] /subsystem=ejb3:remove()
{"outcome" => "success"}
[2] Use the embed-server, which is also useful for just building up a profile.
./bin/jboss-cli.sh
embed-server
/subsystem=ejb3/service=remote:remove()
stop-embedded-server
embed-server- basically starts an in VM JBoss server in the CLI and then run all of the configuration commands on it and then exit. As opposed to actually starting a JBoss server and then connecting to it, the embedded server just runs within the CLI.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.