[jboss-user] [EJB 3.0] - @Service EJB Undeploy error

alpheratz-jb do-not-reply at jboss.com
Wed Nov 15 22:33:58 EST 2006


I have an @Service EJB (see code).

It deploys OK. it works OK. I can see the bean being driven through its lifecycle OK. I can see ssetValue being called. I can see the value in the MBean Inspector page.

However on undeploy/redeploy I get an exception (see traces):


  | java.lang.RuntimeException: javax.management.InstanceNotFoundException: dnd:statistics=DisasterCount is not registered.
  | 

The exception occurs regardless of whether the value is inspected in the MBeans Inspector page or not.

The app is based around SEAM.

Any suggestions/assistance would be gratefully accepted.

Cheers,

Alph.

===========

Usage in a SEAM stateful session bean:


  |   @EJB
  |   private DisasterCountLocal dc;
  |   
  |   @SuppressWarnings("unchecked")
  |   @Factory("disasterCollection")
  |   public void findAll()
  |     {
  |     disasterCollection = em.createNamedQuery("Disaster.findAll").setHint(
  |         "org.hibernate.cacheable", true).getResultList();
  |     dc.setValue(disasterCollection.size());
  |     }
  | 


  | package dnd.mbean;
  | 
  | import javax.ejb.Local;
  | 
  | import org.jboss.annotation.ejb.Service;
  | 
  | // http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html
  | // http://trailblazer.demo.jboss.com/EJB3Trail/serviceobjects/jmx/index.html
  | 
  | @Service (objectName = "dnd:statistics=DisasterCount")
  | @Local(DisasterCountLocal.class)
  | public class DisasterCount implements DisasterCountLocal, DisasterCountManagement
  | {
  | 	int v;
  | 	
  | 	public void setValue(int v)
  | 	{
  | 		System.out.println("setValue(" + v + ")");
  | 	this.v = v;	
  | 	}
  | 	
  | 	public int getValue() {
  | 		return v;
  | 	}
  | 	
  |    // Lifecycle methods
  |    public void create() throws Exception
  |    {
  | 	   System.out.println("DisasterCount - Creating");
  |    }
  | 
  |    public void start() throws Exception
  |    {
  | 	   System.out.println("DisasterCount - Starting");
  |    }
  | 
  |    public void stop()
  |    {
  | 	   System.out.println("DisasterCount - Stopping");
  |    }
  | 
  |    public void destroy()
  |    {
  | 	   System.out.println("DisasterCount - Destroying");
  |    }
  | }
  | 
  | 
  | 



  | package dnd.mbean;
  | 
  | import javax.ejb.Local;
  | 
  | @Local
  | public interface DisasterCountLocal {
  | int getValue();
  | void setValue(int v);
  | }
  | 



  | package dnd.mbean;
  | 
  | import org.jboss.annotation.ejb.Management;
  | 
  | @Management
  | public interface DisasterCountManagement {
  | int getValue();
  | 
  | void create() throws Exception;
  | void start() throws Exception;
  | void stop();
  | void destroy();
  | }
  | 


Deployment trace:


  | 12:22:40,937 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=jboss-seam-dnd.ear,jar=jboss-seam-dnd.jar,name=DisasterCount,service=EJB3 with dependencies:
  | 12:22:40,953 INFO  [EJBContainer] STARTED EJB: dnd.mbean.DisasterCount ejbName: DisasterCount
  | 12:22:40,968 INFO  [STDOUT] DisasterCount - Creating
  | 12:22:40,968 INFO  [STDOUT] DisasterCount - Starting
  | 12:22:40,984 INFO  [EJBContainer] STARTED EJB: dnd.ejb3.session.DisasterManagerAction ejbName: DisasterManagerAction
  | 


Undeploy/redeploy trace:


  | 13:19:35,125 INFO  [STDOUT] DisasterCount - Stopping
  | 13:19:35,125 INFO  [STDOUT] DisasterCount - Destroying
  | 13:19:35,125 WARN  [ServiceDelegateWrapper] Stopping failed jboss.j2ee:ear=jboss-seam-dnd.ear,jar=jboss-seam-dnd.jar,name=DisasterCount,service=EJB3
  | java.lang.RuntimeException: javax.management.InstanceNotFoundException: dnd:statistics=DisasterCount is not registered.
  | 	at org.jboss.ejb3.JmxKernelAbstraction.uninstallMBean(JmxKernelAbstraction.java:159)
  | 	at org.jboss.ejb3.service.ServiceContainer.stop(ServiceContainer.java:166)
  | 	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.ejb3.ServiceDelegateWrapper.stopService(ServiceDelegateWrapper.java:118)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
  | 	at sun.reflect.GeneratedMethodAccessor406.invoke(Unknown Source)
  | 	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:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  | 	at $Proxy0.stop(Unknown Source)
  | 	at org.jboss.system.ServiceController.stop(ServiceController.java:508)
  | 	at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
  | 	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:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy267.stop(Unknown Source)
  | 	at org.jboss.ejb3.JmxKernelAbstraction.uninstallMBean(JmxKernelAbstraction.java:151)
  | 	at org.jboss.ejb3.JmxKernelAbstraction.uninstall(JmxKernelAbstraction.java:175)
  | 	at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:501)
  | 	at org.jboss.ejb3.Ejb3Module.stopService(Ejb3Module.java:107)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
  | 	at sun.reflect.GeneratedMethodAccessor406.invoke(Unknown Source)
  | 	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:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  | 	at $Proxy0.stop(Unknown Source)
  | 	at org.jboss.system.ServiceController.stop(ServiceController.java:508)
  | 	at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
  | 	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:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy36.stop(Unknown Source)
  | 	at org.jboss.ejb3.EJB3Deployer.stop(EJB3Deployer.java:469)
  | 	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:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
  | 	at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
  | 	at org.jboss.ws.integration.jboss.DeployerInterceptor.stop(DeployerInterceptor.java:122)
  | 	at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.stop(SubDeployerInterceptorSupport.java:196)
  | 	at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:99)
  | 	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:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy37.stop(Unknown Source)
  | 	at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:667)
  | 	at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:659)
  | 	at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:638)
  | 	at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:632)
  | 	at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:615)
  | 	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:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	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:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy6.undeploy(Unknown Source)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:450)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:604)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
  | Caused by: javax.management.InstanceNotFoundException: dnd:statistics=DisasterCount is not registered.
  | 	at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:523)
  | 	at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
  | 	at org.jboss.ejb3.JmxKernelAbstraction.uninstallMBean(JmxKernelAbstraction.java:155)
  | 	... 100 more
  | 



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

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



More information about the jboss-user mailing list