0 Replies Latest reply on May 17, 2002 12:25 PM by Andrew

    Exception Deleting Temporary Queue (JBoss 2.4.4)

    Andrew Newbie

      I've got an EJB that create a temporary queue and listens for results from various other processes. When I shut down the server, the ejbRemove method is invoked and I call the following code:

      try{
      if(receiver != null){
      receiver.close();
      }
      if(resultQueue != null){
      resultQueue.delete();
      }
      if(qsession != null){
      qsession.close();
      }
      if(qcon != null){
      qcon.close();
      }
      } catch (JMSException jmse) {
      System.out.println("Exception in trying to remove EJB");
      jmse.printStackTrace();
      }

      When this code is invoked I get the following exception:

      17/05/02 11:53:55 [Default] Controller [CLASS: QueueObject] [ID: 1-1021650809235] Exception in trying to remove EJB
      17/05/02 11:53:55 [Default] org.jboss.mq.SpyJMSException: Cannot delete the TemporaryQueue
      17/05/02 11:53:55 [Default] at org.jboss.mq.SpyTemporaryQueue.delete(SpyTemporaryQueue.java:42)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.gistit.controller.ControllerBean.ejbRemove(ControllerBean.java:365)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.StatelessSessionEnterpriseContext.discard(StatelessSessionEnterpriseContext.java:83)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.plugins.AbstractInstancePool.freeAll(AbstractInstancePool.java:381)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.plugins.AbstractInstancePool.destroy(AbstractInstancePool.java:127)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.StatelessSessionContainer.destroy(StatelessSessionContainer.java:251)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.Application.destroy(Application.java:244)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.ContainerFactory.undeploy(ContainerFactory.java:516)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.ContainerFactory.undeploy(ContainerFactory.java:321)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at java.lang.reflect.Method.invoke(Native Method)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.deployment.J2eeDeployer.stopModule(J2eeDeployer.java:603)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.deployment.J2eeDeployer.stopApplication(J2eeDeployer.java:579)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.deployment.J2eeDeployer.stopService(J2eeDeployer.java:375)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.util.ServiceMBeanSupport.stop(ServiceMBeanSupport.java:138)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at java.lang.reflect.Method.invoke(Native Method)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at $Proxy0.stop(Unknown Source)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.util.ServiceControl.stop(ServiceControl.java:104)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at java.lang.reflect.Method.invoke(Native Method)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.util.Shutdown.shutdownServices(Shutdown.java:87)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.util.Shutdown$1.run(Shutdown.java:56)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] linked exception is:
      17/05/02 11:53:55 [Default] java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
      17/05/02 11:53:55 [Default] at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:115)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:97)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.mq.il.oil.OILClientIL.deleteTemporaryDestination(OILClientIL.java:64)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.mq.SpyTemporaryQueue.delete(SpyTemporaryQueue.java:40)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at com.gistit.controller.ControllerBean.ejbRemove(ControllerBean.java:365)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.StatelessSessionEnterpriseContext.discard(StatelessSessionEnterpriseContext.java:83)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.plugins.AbstractInstancePool.freeAll(AbstractInstancePool.java:381)
      17/05/02 11:53:55 [Default]
      17/05/02 11:53:55 [Default] at org.jboss.ejb.plugins.AbstractInstancePool.destroy(AbstractInstancePool.java:127)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.ejb.StatelessSessionContainer.destroy(StatelessSessionContainer.java:251)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.ejb.Application.destroy(Application.java:244)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.ejb.ContainerFactory.undeploy(ContainerFactory.java:516)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.ejb.ContainerFactory.undeploy(ContainerFactory.java:321)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at java.lang.reflect.Method.invoke(Native Method)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.deployment.J2eeDeployer.stopModule(J2eeDeployer.java:603)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.deployment.J2eeDeployer.stopApplication(J2eeDeployer.java:579)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.deployment.J2eeDeployer.stopService(J2eeDeployer.java:375)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.util.ServiceMBeanSupport.stop(ServiceMBeanSupport.java:138)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at java.lang.reflect.Method.invoke(Native Method)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at $Proxy0.stop(Unknown Source)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.util.ServiceControl.stop(ServiceControl.java:104)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at java.lang.reflect.Method.invoke(Native Method)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.util.Shutdown.shutdownServices(Shutdown.java:87)
      17/05/02 11:53:56 [Default]
      17/05/02 11:53:56 [Default] at org.jboss.util.Shutdown$1.run(Shutdown.java:56)


      It looks to me like the OILServerIL is closing down before my ejbRemove code gets called and this would result in the inability to connect to it, hence the exception.

      Is this what is happening? If so, when should I be performing the delete of the Temporary Queue?

      If this is not the case, can anyone give me an idea of where to start troubleshooting?

      Thanks.