Created attachment 1329339 [details] MBean Clients Description of problem: NullPointerException during JMX query on undeployed application Below exception is thrown:- ~~~~~~~ 00:26:03,439 ERROR [org.jboss.as.controller.management-operation] (pool-1-thread-1) JBAS014612: Operation ("read-attribute") failed - address: ([ ("deployment" => "jboss-helloworld-1.0.war"), ("subsystem" => "web") ]): java.lang.NullPointerException at org.jboss.as.web.WebDeploymentDefinition$SessionManagerStatsHandler.executeRuntimeStep(WebDeploymentDefinition.java:107) at org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:89) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:710) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:545) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:338) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:314) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1152) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:335) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:191) [jboss-as-controller-7.5.16.Final-redhat-SNAPSHOT.jar:7.5.16.Final-redhat-SNAPSHOT] at org.jboss.as.jmx.model.ModelControllerMBeanHelper.execute(ModelControllerMBeanHelper.java:529) at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:306) at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:267) at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.getAttribute(ModelControllerMBeanServerPlugin.java:130) at org.jboss.as.jmx.PluggableMBeanServerImpl.getAttribute(PluggableMBeanServerImpl.java:356) at org.jboss.as.jmx.BlockingNotificationMBeanServer.getAttribute(BlockingNotificationMBeanServer.java:148) at org.jboss.remotingjmx.protocol.v2.ServerProxy$GetAttributeHandler.handle(ServerProxy.java:691) at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153) at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:75) at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:70) ~~~~~~~~~~~ Steps to reproduce 1) Start a JBoss EAP 6.4 instance with standalone.sh 2) Run the following CLI commands: /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-interval, value=0) /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled, value=false) 3) Copy jboss-helloworld-1.0.war to $JBOSS_HOME/standalone/deployments 4) Run the CLI command: /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled, value=true) 5) Application deploys successfully. Verify with MBeanClient.java, it will succeed. 6) Run the CLI command: /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled, value=false) 7) Delete the file $JBOSS_HOME/standalone/deployments/jboss-helloworld-1.0.war 8) Copy jboss-helloworld-2.0.war to $JBOSS_HOME/standalone/deployments. Version 2.0 has a dependency on a static module that does not exist 9) Run the CLI command: /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled, value=true) 10) JBoss begins to undeploy version 1.0, and deploy version 2.0. Deployment of version 2.0 fails due to a missing module dependency. Deployment of version 2.0 rolls back. When deployment of version 2.0 fails, the undeploy of 1.0 tries to roll back. But since the war file was removed, the roll back of 1.0 fails and leaves the deployment in a bad state. 11) MBeanClient.java. It fails and a NullPointerException is generated on the server. Expected behaviour:- JBoss should not throw a NullPointerException. It should throw an informational exception such as javax.management.AttributeNotFoundException or similar.
Created attachment 1329340 [details] sampleAppV1
Created attachment 1329341 [details] sampleAppV2
Regression tests passed Verified with EAP 6.4.20.CP.CR1