3 Replies Latest reply on Aug 27, 2002 10:31 AM by Kuba Nowakowski

    Duplicate message.header.messageId

    Kuba Nowakowski Newbie

      Hi

      I'm getting the following ex while sending messages to Queue.

      using JBoss 3.0.0 - tomcat 4.0.3

      in my application there is a servlet which sends messages to Queue and Message Driven Beans which listens on this queue. I also use mysql persistence

      when i deployed my applications without MDB it seems to be ok. but when there is whole application deployed, from time to time i'm getting this error;

      i've also noticed that the message with that id in table JMS_MESSAGES had txop = "T" while others had "A" ( whatever T or A means)


      org.jboss.mq.SpyJMSException: Could not store message: 2440
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(Compiled Code)@a15aa80
      at org.jboss.mq.server.PersistentQueue.addMessage(Compiled Code)@a15a990
      at org.jboss.mq.server.JMSQueue.addMessage(Compiled Code)@a15a8e0
      at org.jboss.mq.server.JMSDestinationManager.addMessage(Compiled Code)@a15a800
      at org.jboss.mq.server.JMSDestinationManager.addMessage(Compiled Code)@a15a7a0
      at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(Compiled Code)@a15a760
      at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(Compiled Code)@a15a550
      at org.jboss.mq.server.TracingInterceptor.addMessage(Compiled Code)@a15a380
      at org.jboss.mq.server.JMSServerInvoker.addMessage(Compiled Code)@a15a340
      at org.jboss.mq.il.jvm.JVMServerIL.addMessage(Compiled Code)@a15a2c0
      at org.jboss.mq.Connection.sendToServer(Compiled Code)@a15a220
      at org.jboss.mq.SpySession.sendMessage(Compiled Code)@a15a150
      at org.jboss.mq.SpyQueueSender.internalSend(Compiled Code)@a159ca0
      at org.jboss.mq.SpyQueueSender.send(Compiled Code)@a159c00
      linked exception is:
      java.sql.SQLException: Invalid argument value: Duplicate entry '2440-QUEUE.MMMessageQueue' for key 1
      at com.mysql.jdbc.MysqlIO.sendCommand(Compiled Code)@99330d0
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Compiled Code)@9935160
      at com.mysql.jdbc.Connection.execSQL(Compiled Code)@9934bf0
      at com.mysql.jdbc.PreparedStatement.executeUpdate(Compiled Code)@9938950
      at com.mysql.jdbc.PreparedStatement.executeUpdate(Compiled Code)@99388f0
      at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeUpdate(Compiled Code)@9851430
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(Compiled Code)@a15ada0
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(Compiled Code)@a15aa80
      at org.jboss.mq.server.PersistentQueue.addMessage(Compiled Code)@a15a990
      at org.jboss.mq.server.JMSQueue.addMessage(Compiled Code)@a15a8e0
      at org.jboss.mq.server.JMSDestinationManager.addMessage(Compiled Code)@a15a800
      at org.jboss.mq.server.JMSDestinationManager.addMessage(Compiled Code)@a15a7a0
      at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(Compiled Code)@a15a760
      at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(Compiled Code)@a15a550
      at org.jboss.mq.server.TracingInterceptor.addMessage(Compiled Code)@a15a380
      at org.jboss.mq.server.JMSServerInvoker.addMessage(Compiled Code)@a15a340
      at org.jboss.mq.il.jvm.JVMServerIL.addMessage(Compiled Code)@a15a2c0
      at org.jboss.mq.Connection.sendToServer(Compiled Code)@a15a220
      at org.jboss.mq.SpySession.sendMessage(Compiled Code)@a15a150
      at org.jboss.mq.SpyQueueSender.internalSend(Compiled Code)@a159ca0
      at org.jboss.mq.SpyQueueSender.send(Compiled Code)@a159c00

      thanks in advance

      Kuba

        • 1. Re: Duplicate message.header.messageId
          Kuba Nowakowski Newbie

          Hi

          There is some bug in MessageCache and MessageReference

          When system reached HighMemoryMark last message i added was converted to soft reference and added to database with jdbc2.PersistenceManager.saveToStorage(,,,"T")


          after that PersistenceManager was trying to add this message to the store by calling method add

          flag messageRef.isStored is set to false because messageRef was invalidated before calling add

          to get this error just set highMemoryMark and MaxMemoryMark for example to 50


          in MessageReference.invalidate()

          removeFromStorage is called but implementation of this method in jdbc2.PersistenceManager has following code :

          if( messageRef.getHeaders().jmsDeliveryMode == DeliveryMode.PERSISTENT )
          return;

          so the message still is in db but isStored is set to false

          i suggest to move this 2 lines to MessageReference.clear() and is jmsDeliveryMode == Persistent leave isStored to true

          regards
          Kuba


          • 2. Re: Duplicate message.header.messageId
            Kuba Nowakowski Newbie

            Hi

            There is some bug in MessageCache and MessageReference

            When system reached HighMemoryMark last message i added was converted to soft reference and added to database with jdbc2.PersistenceManager.saveToStorage(,,,"T")


            after that PersistenceManager was trying to add this message to the store by calling method add

            flag messageRef.isStored is set to false because messageRef was invalidated before calling add

            to get this error just set highMemoryMark and MaxMemoryMark for example to 50


            in MessageReference.invalidate()

            removeFromStorage is called but implementation of this method in jdbc2.PersistenceManager has following code :

            if( messageRef.getHeaders().jmsDeliveryMode == DeliveryMode.PERSISTENT )
            return;

            so the message still is in db but isStored is set to false

            i suggest to move this 2 lines to MessageReference.clear() and is jmsDeliveryMode == Persistent leave isStored to true

            regards
            Kuba

            • 3. Re: Duplicate message.header.messageId
              Kuba Nowakowski Newbie

              why there is Replies = 2 and i can see only question?
              test reply