4 Replies Latest reply on Dec 21, 2007 10:34 AM by adrian.brock

    Unable to browse messages in queue LRUCache error

    tnine

      Hi all,
      I'm attempting to browse the DLQ in Jboss MQ in order to log the messages for inspection and review by our developers. I'm getting a very strange error when I try to get an enumeration. I'm connecting to remote queue via JNDI

      Enumeration queueContents = browser.getEnumeration();


      Causes the following error below. I'm assuming this is a duplicate hashcode issue, but how can I change the implementation so that collisions don't occur?

      org.jboss.mq.SpyJMSException: Cannot browse the Queue; - nested throwable: (java.lang.RuntimeException: Can't add object '2 msg=232 STORED PERSISTENT queue=QUEUE.DLQ priority=4 lateClone=false hashCode=22159791' to LRUCache that is already in cache.)
       at org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:66)
       at org.jboss.mq.SpyJMSException.rethrowAsJMSException(SpyJMSException.java:51)
       at org.jboss.mq.Connection.browse(Connection.java:861)
       at org.jboss.mq.SpyQueueBrowser.getEnumeration(SpyQueueBrowser.java:83)
       at com.purdueefcu.statements.writer.jms.QueueInspectorImpl.getQueueContents(QueueInspectorImpl.java:81)
       at com.purdueefcu.statements.writer.jms.QueueInspectorImpl.getFailedProcessMessages(QueueInspectorImpl.java:41)
       at com.purdueefcu.statements.QueueInspectorTest.testGetFailedProcessMessages(QueueInspectorTest.java:16)
       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 junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: java.lang.RuntimeException: Can't add object '2 msg=232 STORED PERSISTENT queue=QUEUE.DLQ priority=4 lateClone=false hashCode=22159791' to LRUCache that is already in cache.
       at org.jboss.mq.server.MessageCache$LRUCache.addMostRecent(MessageCache.java:791)
       at org.jboss.mq.server.MessageCache.messageReferenceUsedEvent(MessageCache.java:401)
       at org.jboss.mq.server.MessageReference.getMessage(MessageReference.java:168)
       at org.jboss.mq.server.MessageReference.getMessageForDelivery(MessageReference.java:147)
       at org.jboss.mq.server.BasicQueue.browse(BasicQueue.java:509)
       at org.jboss.mq.server.JMSQueue.browse(JMSQueue.java:161)
       at org.jboss.mq.server.JMSDestinationManager.browse(JMSDestinationManager.java:597)
       at org.jboss.mq.server.JMSServerInterceptorSupport.browse(JMSServerInterceptorSupport.java:136)
       at org.jboss.mq.security.ServerSecurityInterceptor.browse(ServerSecurityInterceptor.java:99)
       at org.jboss.mq.server.TracingInterceptor.browse(TracingInterceptor.java:418)
       at org.jboss.mq.server.JMSServerInvoker.browse(JMSServerInvoker.java:142)
       at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:116)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:395)
       at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
       at java.lang.Thread.run(Thread.java:595)