[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Callbacks and new classloader changes

adrian@jboss.org do-not-reply at jboss.com
Tue Feb 5 13:04:33 EST 2008


If you are seeing ServiceController.shutdown()
then it means there are MBeans not getting undeployed in the proper way,
i.e. uninstalled by the deployment or service that constructed them.

The ServiceController.shutdown() is only really a hack to fix broken stuff
in the case where the JVM is not really shutdown and would cause leaks otherwise.

The same goes for the BasicKernelDeployer.shutdown()

In this case, it looks like the issue is in
system-jmx/src/main/org/jboss/system/microcontainer/jmx/ServiceControllerLifecycleCallback.java
which implements the @JMX handling.

It is only invoking the destroy() on the MBean.
It is not removing the reference from the ServiceController, etc. via remove()


  |    public void uninstall(ControllerContext context) throws Exception
  |    {
  |       JMX jmx = readJmxAnnotation(context);
  |       ObjectName objectName = createObjectName(context, jmx); 
  | 
  |       log.debug("Unregistering MBean " + objectName);
  |       serviceController.destroy(objectName);
  | +      serviceController.remove(objectName);
  |    }
  | 

So the JMXKernel.shutdown() is trying to clean this up and failing.

But rather than just fix this, I want to understand why the callbacks
are being invoked on a context that doesn't exist 
(something wrong with dependencies?) and what those
callbacks might be?

I'd have more information if this was a better error message.
Why is there no contextual information?


  |       // let's make sure we suppress any exceptions
  |       catch (Throwable t)
  |       {
  | -         log.warn("Cannot resolve callbacks.", t);
  | +         log.warn("Cannot resolve callbacks state=" + state + " isInstall=" + isInstallPhase + + " context="context + , t);
  |       }
  | 


  | 23:36:28,187 WARN  [AbstractKernelController] Cannot resolve callbacks.
  | javax.management.InstanceNotFoundException: jboss.jca:service=JCAMetaDataRepository,name=DefaultJCAM
  | etaDataRepository is not registered.
  |         at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
  |         at org.jboss.mx.server.MBeanServerImpl.getClassLoaderFor(MBeanServerImpl.java:1062)
  |         at org.jboss.system.microcontainer.ServiceControllerContext.getClassLoader(ServiceController
  | Context.java:167)
  |         at org.jboss.dependency.plugins.SecurityActions.setContextClassLoader(SecurityActions.java:4
  | 6)
  |         at org.jboss.dependency.plugins.AbstractController.resolveCallbacks(AbstractController.java:
  | 1174)
  |         at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:
  | 1006)
  |         at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:
  | 936)
  |         at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:463)
  |         at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:426)
  | 

Who, where, what, why, when? :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126672#4126672

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126672



More information about the jboss-dev-forums mailing list