Bug 1494329

Summary: [GSS](6.4.z) NullPointerException during JMX query on undeployed application
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: shailendra kumar singh <shsingh>
Component: Web, JMXAssignee: Lin Gao <lgao>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Cada <mcada>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.16CC: bmaxwell, bparry, cdewolf, jondruse, lgao, rmaucher
Target Milestone: CR1   
Target Release: EAP 6.4.20   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-19 12:41:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1510090    
Attachments:
Description Flags
MBean Clients
none
sampleAppV1
none
sampleAppV2 none

Description shailendra kumar singh 2017-09-22 04:19:28 UTC
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.

Comment 1 shailendra kumar singh 2017-09-22 04:20:18 UTC
Created attachment 1329340 [details]
sampleAppV1

Comment 2 shailendra kumar singh 2017-09-22 04:20:46 UTC
Created attachment 1329341 [details]
sampleAppV2

Comment 14 Jiří Bílek 2018-04-27 12:00:25 UTC
Regression tests passed
Verified with EAP 6.4.20.CP.CR1