[JBoss-dev] InstanceAlreadyExistsException afterundeployandrepeated deploy in JBoss AS 5.0.0 Beta
Adrian Brock
adrian_brock at jboss.org
Wed Aug 16 09:49:17 EDT 2006
On Tue, 2006-08-15 at 18:07 -0500, Brian Stansberry wrote:
> I believe the EJB container is not being unregistered from the
> MBeanServer. In Branch_4_0 it worked like this:
>
> Registration: EjbModule.createService() -->
> MBeanServer.registerMBean()
> Unregistration: EjbModule.destroyService() -->
> ServiceController.remove() --> ServiceCreator.remove() -->
> MBeanServer.unregisterMBean()
>
> That seems like a pairing of actions that could easily get broken.
You are correct Brian, the old service controller does
unregisterMBean() from remove()
even when it didn't register it in the first place!
This makes the protocol asymmetric as you described
install:
MBeanServer.registerMBean();
ServiceController.register();
uninstall:
ServiceController.remove(); // does MBeanServer.unregisterMBean()
I've fixed the new implementation to do the same thing,
but it also shows my test coverate isn't as great as I
thought it was. :-)
Also, this change causes "problems" for web deployments
(looks like they being unregistered from the MBeanServer
rather than being removed from the ServiceController?):
2006-08-16 15:30:34,810 DEBUG [org.jboss.deployment.MainDeployer]
Undeployed 82 deployed packages
2006-08-16 15:30:34,810 DEBUG [org.jboss.system.server.Server] Shutting
down all services
2006-08-16 15:30:34,810 DEBUG [org.jboss.system.ServiceController]
Stopping 8 services
2006-08-16 15:30:34,811 TRACE
[org.jboss.kernel.plugins.dependency.AbstractKernelController]
Uninstalling name=jboss.web.deployment:id=-568272677,war=jmx-console.war
state=Configured mode=Manual requiredState=Configured
2006-08-16 15:30:34,811 TRACE
[org.jboss.kernel.plugins.dependency.AbstractKernelController]
Uninstalling jboss.web.deployment:id=-568272677,war=jmx-console.war from
Configured
2006-08-16 15:30:34,811 TRACE
[org.jboss.kernel.plugins.dependency.AbstractKernelController]
Uninstalling jboss.web.deployment:id=-568272677,war=jmx-console.war from
Instantiated
2006-08-16 15:30:34,811 DEBUG [org.jboss.system.ServiceCreator] Removing
mbean from server:
jboss.web.deployment:war=jmx-console.war,id=-568272677
2006-08-16 15:30:34,812 DEBUG [org.jboss.system.ServiceCreator] Error
unregistering mbean
jboss.web.deployment:war=jmx-console.war,id=-568272677
javax.management.InstanceNotFoundException:
jboss.web.deployment:war=jmx-console.war,id=-568272677 is not
registered.
at
org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:527)
at
org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
at
org.jboss.system.ServiceCreator.uninstall(ServiceCreator.java:309)
at
org.jboss.system.microcontainer.OnlyUnregisterAction.uninstallAction(OnlyUnregisterAction.java:45)
at
org.jboss.system.microcontainer.ServiceControllerContextAction.uninstall(ServiceControllerContextAction.java:90)
at
org.jboss.dependency.plugins.AbstractControllerContextActions.uninstall(AbstractControllerContextActions.java:58)
at
org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:236)
at
org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:723)
at
org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:685)
at
org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:613)
at
org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:223)
at
org.jboss.system.ServiceController.shutdown(ServiceController.java:549)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.server.ServerImpl
$ShutdownHook.shutdownServices(ServerImpl.java:1070)
at org.jboss.system.server.ServerImpl
$ShutdownHook.shutdown(ServerImpl.java:1028)
at org.jboss.system.server.ServerImpl
$ShutdownHook.run(ServerImpl.java:987)
--
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxx
More information about the jboss-development
mailing list