Author: alessio.soldano(a)jboss.com
Date: 2012-02-13 11:29:37 -0500 (Mon, 13 Feb 2012)
New Revision: 15631
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
Adding check for null before accessing mbeanServer in AbstractServerConfig
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2012-02-10
17:08:41 UTC (rev 15630)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2012-02-13
16:29:37 UTC (rev 15631)
@@ -203,12 +203,18 @@
this.stackConfig = spiProvider.getSPI(StackConfigFactory.class,
cl).getStackConfig();
log.info(getImplementationTitle() + ' ' + getImplementationVersion());
- getMbeanServer().registerMBean(this, AbstractServerConfigMBean.OBJECT_NAME);
+ MBeanServer mbeanServer = getMbeanServer();
+ if (mbeanServer != null) {
+ mbeanServer.registerMBean(this, AbstractServerConfigMBean.OBJECT_NAME);
+ }
}
public void destroy() throws Exception
{
- getMbeanServer().unregisterMBean(AbstractServerConfigMBean.OBJECT_NAME);
+ MBeanServer mbeanServer = getMbeanServer();
+ if (mbeanServer != null) {
+ mbeanServer.unregisterMBean(AbstractServerConfigMBean.OBJECT_NAME);
+ }
}
public String getImplementationTitle()