[Design of POJO Server] - ServiceControllerLifecycleCallback to unregister mbean?
by bstansberry@jboss.com
Should the ServiceControllerLifecycleCallback be unregistering mbeans in uninstall()? It's doing the registration in install(), but I'm not seeing any unregister call (unless it's buried in the KernelController.)
I'm seeing problems with this in the EJB3 testsuite where I have an @JMX bean that gets deployed/undeployed in one test class and then deployed again in another.
The initial undeploy goes fine:
| 2007-12-11 12:19:33,855 DEBUG [org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback] Unregistering MBean jboss.cache:service=OptimisticEJB3EntityTreeCache
| 2007-12-11 12:19:33,855 DEBUG [org.jboss.system.ServiceController] destroying service: jboss.cache:service=OptimisticEJB3EntityTreeCache
| 2007-12-11 12:19:33,855 DEBUG [org.jboss.cache.CacheStatus] Ignoring call to stop() as current state is DESTROYED
| 2007-12-11 12:19:33,855 DEBUG [org.jboss.cache.CacheStatus] Ignoring call to destroy() as current state is DESTROYED
| 2007-12-11 12:19:33,861 DEBUG [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] Removed component OptimisticTestEJB3EntityCacheRuntimeConfig from vfsfile:/home/bes/dev/jboss/clean/trunk/ejb3/output/test-lib/optimistic-entity-cache-beans.xml
| 2007-12-11 12:19:33,862 DEBUG [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] Removed component OptimisticTestEJB3EntityDefaultLRUConfig from vfsfile:/home/bes/dev/jboss/clean/trunk/ejb3/output/test-lib/optimistic-entity-cache-beans.xml
But then a subsequent deploy of the same -beans.xml fails because the old registration is still there:
2007-12-11 12:19:36,352 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Configured: name=OptimisticTestEJB3EntityCache state=Configured
| java.lang.Exception: Error calling callback JMXAdvice for target context OptimisticTestEJB3EntityCache
| at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.install(AbstractLifecycleCallbackItem.java:86)
| ....
| Caused by: javax.management.InstanceAlreadyExistsException: jboss.cache:service=OptimisticEJB3EntityTreeCache already registered.
| at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
| ....
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
| at org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback.install(ServiceControllerLifecycleCallback.java:90)
| ....
| at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.install(AbstractLifecycleCallbackItem.java:82)
| ... 76 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112076#4112076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112076
18 years, 4 months
[Design the new POJO MicroContainer] - Re: setting managed property of type List
by alesj
OK, this is deeper problem, than I anticipated earlier.
There is a problem of interfaces/abstract classes, if you explicitly use interface/abstract class Type(Info) as a parameter in MetaTypeFactory.create. Since that is what is then used to create metatype instance, from which we later on gather information to do the unwrapping (for composite and collection). Thus failing to instantiate new instance.
But if you use straight MetaTypeFactory.create with only value parameter, it should go through.
Adrian, what's to do here?
Using the more restrictive TypeInfo in DefaultMetaValueFactory.internalCreate?
| protected MetaValue internalCreate(Object value, TypeInfo type, MetaType metaType)
| {
| if (value == null)
| return null;
|
| if (type == null || (type instanceof ClassInfo && ((ClassInfo)type).isInterface()))
| type = configuration.getTypeInfo(value.getClass());
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112006#4112006
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112006
18 years, 4 months
[Design the new POJO MicroContainer] - Re: setting managed property of type List
by alex.loubyansky@jboss.com
No, still fails.
java.lang.reflect.UndeclaredThrowableException
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.unwrapCollection(DefaultMetaValueFactory.java:699)
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.internalUnwrap(DefaultMetaValueFactory.java:539)
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.unwrap(DefaultMetaValueFactory.java:481)
| at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.setValue(AbstractManagedObjectFactory.java:753)
| at org.jboss.managed.plugins.WritethroughManagedPropertyImpl.setValue(WritethroughManagedPropertyImpl.java:111)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.writeTemplate(DsDataSourceTemplate.java:148)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.applyTemplate(DsDataSourceTemplate.java:69)
| at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:552)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:56)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:771)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| Caused by: org.jboss.joinpoint.spi.JoinpointException: Constructor not found java.util.List[] no constructors
| at org.jboss.joinpoint.plugins.Config.findConstructorInfo(Config.java:276)
| at org.jboss.joinpoint.plugins.Config.getConstructorJoinpoint(Config.java:150)
| at org.jboss.beans.info.plugins.AbstractBeanInfo.newInstance(AbstractBeanInfo.java:221)
| at org.jboss.beans.info.plugins.AbstractBeanInfo.newInstance(AbstractBeanInfo.java:216)
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.createNewInstance(DefaultMetaValueFactory.java:726)
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.unwrapCollection(DefaultMetaValueFactory.java:684)
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.internalUnwrap(DefaultMetaValueFactory.java:539)
| at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.unwrap(DefaultMetaValueFactory.java:481)
| at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.setValue(AbstractManagedObjectFactory.java:753)
| at org.jboss.managed.plugins.WritethroughManagedPropertyImpl.setValue(WritethroughManagedPropertyImpl.java:111)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.writeTemplate(DsDataSourceTemplate.java:148)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.applyTemplate(DsDataSourceTemplate.java:69)
| at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:552)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:56)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:771)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at AOPProxy$1.applyTemplate(AOPProxy$1.java)
| at org.jboss.test.profileservice.test.ProfileServiceUnitTestCase.testAddXADataSource(ProfileServiceUnitTestCase.java:434)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at AOPProxy$1.applyTemplate(AOPProxy$1.java)
| at org.jboss.test.profileservice.test.ProfileServiceUnitTestCase.testAddXADataSource(ProfileServiceUnitTestCase.java:434)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111981#4111981
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111981
18 years, 4 months