1 Reply Latest reply on May 8, 2003 4:49 PM by Adrian Brock

    Help: JMX timer fails to undeploy when called from sar file

    Naomi Newbie

      Hi,

      I'm working on a project where I want to use JMX timers. During
      startup, the application creates a timer, and I declare a Listener to
      receive the events. The startup class is packaged in a sar, and the
      timer in a different jar (since it's not a service).

      Everything works fine, as far as the timer is concerned, and I get the
      events back properly. But when I undeploy my application (on
      redeployment) I sometimes (not always) get exceptions thrown (see
      below) about "Error creating MBeanProxy: jboss:service=WebService".

      My suspicions being on MBean dependencies, I've played around to
      declare my sar file to depend on several things, including, of course,
      jboss:service=WebService (see below). That actually made the
      exceptions less frequent, but they still persist after about 3 or so
      undeployments. After I get the exception, I need to shutdown the
      server, btw, as the timer will never start properly again.

      Any hints?

      I'm using jboss 3.20+tomcat 4.1.24.

      Thanks so much in advance,

      Naomi



      ************************************************************
      jboss-service.xml (in the sar file)





      jboss.web:service=WebServer
      jboss:service=WebService





      ************************************************************
      server.log

      14:29:55,320 INFO [EjbModule] Destroying
      14:29:55,322 ERROR [EjbModule] Destroying failed
      org.jboss.util.NestedRuntimeException: Error creating MBeanProxy: jboss:service=WebService; - nested throwable: (javax.management.InstanceNotFoundException: jboss:service=WebService is not registered.)
      at org.jboss.mx.util.MBeanProxyExt.(MBeanProxyExt.java:79)
      at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:283)
      at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:248)
      at org.jboss.ejb.EjbModule.destroyService(EjbModule.java:376)
      at org.jboss.system.ServiceMBeanSupport.destroy(ServiceMBeanSupport.java:271)
      at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
      at $Proxy11.destroy(Unknown Source)
      at org.jboss.system.ServiceController.destroy(ServiceController.java:521)
      at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy19.destroy(Unknown Source)
      at org.jboss.ejb.EJBDeployer.destroy(EJBDeployer.java:582)
      at org.jboss.deployment.MainDeployer.destroy(MainDeployer.java:530)
      at org.jboss.deployment.MainDeployer.destroy(MainDeployer.java:546)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:481)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:475)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:448)
      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:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.undeploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:310)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:393)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)
      Caused by: javax.management.InstanceNotFoundException: jboss:service=WebService is not registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:354)
      at org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java:560)
      at org.jboss.mx.util.MBeanProxyExt.(MBeanProxyExt.java:71)
      ... 38 more