0 Replies Latest reply on Oct 12, 2003 8:37 AM by arabin

    Is there a way to destroy a Queue without an error?

    arabin

      I am trying to destroy a Queue, that has a QueueReceiver open, visa destination manager.

      I am having this error message:

      2003-10-12 08:38:21,177 INFO [org.jboss.mq.server.jmx.Queue.1065965817627] Destroying
      2003-10-12 08:38:21,187 ERROR [org.jboss.mq.server.jmx.Queue.1065965817627] Destroying failed
      javax.jms.JMSException: The destination is being used.
      at org.jboss.mq.server.JMSDestinationManager.closeDestination(JMSDestinationManager.java:794)
      at org.jboss.mq.server.jmx.DestinationMBeanSupport.destroyService(DestinationMBeanSupport.java:138)
      at org.jboss.system.ServiceMBeanSupport.destroy(ServiceMBeanSupport.java:284)
      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:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy42.destroy(Unknown Source)
      at org.jboss.system.ServiceController.destroy(ServiceController.java:531)
      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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy23.destroy(Unknown Source)
      at org.jboss.mq.server.jmx.DestinationManager.destroyDestination(DestinationManager.java:225)
      at org.jboss.mq.server.jmx.DestinationManager.destroyQueue(DestinationManager.java:205)
      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:546)
      at com.wrn.teamworks.cms.cms.MBeanInvoker.invokeLocal(MBeanInvoker.java:227)
      at com.wrn.teamworks.cms.cms.MBeanInvoker.destroyQueueByName(MBeanInvoker.java:174)
      at com.wrn.teamworks.cms.cms.MessageResourceManager.destroyQueuesToDestroy(MessageResourceManager.java:292)
      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:546)
      at com.wrn.teamworks.cms.cms.MBeanInvoker.invokeLocal(MBeanInvoker.java:227)
      at com.wrn.teamworks.cms.cms.SchedulableStartup.callDestroyQueues(SchedulableStartup.java:71)
      at com.wrn.teamworks.cms.cms.SchedulableStartup.perform(SchedulableStartup.java:35)
      at org.jboss.varia.scheduler.Scheduler$Listener.handleNotification(Scheduler.java:1263)
      at org.jboss.mx.server.NotificationListenerProxy.handleNotification(NotificationListenerProxy.java:71)
      at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:97)
      at javax.management.timer.Timer.sendNotifications(Timer.java:441)
      at javax.management.timer.Timer.access$000(Timer.java:31)
      at javax.management.timer.Timer$RegisteredNotification.doRun(Timer.java:612)
      at org.jboss.mx.util.SchedulableRunnable.run(SchedulableRunnable.java:164)
      at org.jboss.mx.util.ThreadPool$Worker.run(ThreadPool.java:225)
      2003-10-12 08:38:21,627 INFO [org.jboss.mq.server.jmx.Queue.1065965817627] Destroyed

      Is there a way to suppress this error message?
      There is no way for me to destroy the queue correctly, because I can do it only in onMessage code, where the acknowledgement does not come through this way. The other way is instead of destroying the queue to schedule the destroying, what I did. Then later, whan I destroy the queue from the scheduler, this message comes. The queue is successfully destroed though.

      As fas as I understand this message handles everything correctly for me, and it just closes the QueueReceiver, that is attached to the Queue.

      Instead of having this message I would prefer to find the QueueReceiver somehow, and close it myself, from the schedulre, before destroying the queue. Then I will not have this terrible exception.

      So, my question is whether it is possible to close receivers, attached to the queue, programmatically and correctly, just by queue name or jndi name.