Bug 1110117 - [GSS] (6.4.0) Querying patching MBeans during shutdown results in IllegalStateException
Summary: [GSS] (6.4.0) Querying patching MBeans during shutdown results in IllegalStat...
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Patching
Version: 6.2.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: DR1
: EAP 6.4.0
Assignee: Brian Stansberry
QA Contact: Jan Martiska
Depends On:
Blocks: 1120535 1120537
TreeView+ depends on / blocked
Reported: 2014-06-17 05:23 UTC by James Livingston
Modified: 2019-08-19 12:45 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
An attempt to query the patch status of a JBoss EAP instance could previously result in an `IllegalStateException` error being thrown. The root cause of this error was that the `InstallationManagerService` was not available as it had already been shut down. This issue has now been resolved by first checking if the `InstallationManagerService` is available and if so, the query proceeds.
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 962723 None None None Never
Red Hat One Jira Issue Tracker WFLY-3505 Major Resolved IllegalStateException when patching MBeans are queried during shutdown 2018-04-24 10:25:31 UTC

Description James Livingston 2014-06-17 05:23:46 UTC
If the MBeans for the patching subsystem are queried during server shutdown, it can result in an IllegalStateException. InstallationManagerService has already had stop() called on it, so the value is null.

This can be reproduced by the attached EJB, which does a MBeanServer.queryMBeans(null, null); from the @PreDestroy method. It's in a loop to ensure it runs after the installation manager gets de-initialised.

at org.jboss.as.patching.installation.InstallationManagerService.getValue(InstallationManagerService.java:87) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.patching.installation.InstallationManagerService.getValue(InstallationManagerService.java:28) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl.getValue(ServiceControllerImpl.java:1158) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.as.patching.management.PatchResource$ElementProviderResourceProvider.children(PatchResource.java:139) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.patching.management.PatchResource$ElementProviderResourceProvider.hasChildren(PatchResource.java:134) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.registry.AbstractModelResource.hasChildren(AbstractModelResource.java:81) [wildfly-controller-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.registry.AbstractModelResource$DelegateResource.hasChildren(AbstractModelResource.java:279) [wildfly-controller-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:57) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:61) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.RootResourceIterator.iterate(RootResourceIterator.java:43) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.ModelControllerMBeanHelper.queryMBeans(ModelControllerMBeanHelper.java:125) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.queryMBeans(ModelControllerMBeanServerPlugin.java:159) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.PluggableMBeanServerImpl.queryMBeans(PluggableMBeanServerImpl.java:816) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at example.ShutdownMBeanQuery.destroy(ShutdownMBeanQuery.java:23)

Comment 4 Scott Mumford 2014-08-01 03:51:27 UTC
Is this only fixed in 6.4.0? Is it therefore a known issue in 6.3.0?

Pasting Bug Fix version of the release note here for future use:

"In previous releases of JBoss EAP 6, the patching subsystem `PatchResource`, while not having a dependency on the `InstallationManagerService`, may have attempted to use it when it may be shut down

This could cause an `IllegalStateException` to be thrown if a shutdown hook attempted to query the patching subsystem MBeans.

This release adds a check to confirm whether the `InstallationManagerService` is up prior to using it, thus avoiding the `IllegalStateException`."

Using Known Issue version of text for 6.3.0 Release Notes as issue not resolved at the time of writing.

Comment 6 Martin Simka 2014-09-18 12:50:25 UTC
verified on EAP 6.4.0.DR1.1

Comment 8 Dimitris Andreadis 2015-02-03 21:03:17 UTC
re-assign Emanuel's assigned bugs to Brian.

Note You need to log in before you can comment on or make changes to this bug.