9 Replies Latest reply on Jun 21, 2006 9:50 AM by Tim Fox

    Failed to remove delivery <messageId>

    Mark P Ashworth Newbie

      Good Day,

      I am sending 1000 messages to the JBoss Messaging server which is configured to store the messages in Derby 10.0.1.

      I am sending messages on the client side with no transaction and Session.AUTO_ACKNOWLEDGE and the messages are NON_PERSISTENT.

      Every now ang again I get the following exception.

      2006-06-21 13:21:41,890 ERROR [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] Exception occured
      org.jboss.messaging.core.tx.TransactionException: Failed to remove delivery 8551
      at org.jboss.jms.server.endpoint.ServerConsumerEndpoint$DeliveryCallback.afterCommit(ServerConsumerEndpoint.java:721)
      at org.jboss.messaging.core.tx.Transaction.commit(Transaction.java:186)
      at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:390)
      at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:99)
      at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
      at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:126)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:842)
      at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:82)
      at org.jboss.remoting.Client.invoke(Client.java:610)
      at org.jboss.remoting.Client.invoke(Client.java:602)
      at org.jboss.jms.client.delegate.DelegateSupport.invoke(DelegateSupport.java:112)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
      at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:134)
      at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
      at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
      at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)
      at org.jboss.jms.tx.ResourceManager.sendTransactionXA(ResourceManager.java:406)
      at org.jboss.jms.tx.ResourceManager.commit(ResourceManager.java:194)
      at org.jboss.jms.tx.MessagingXAResource.commit(MessagingXAResource.java:116)
      at org.jboss.tm.TransactionImpl$Resource.commit(TransactionImpl.java:2253)
      at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1784)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:340)
      at org.jboss.tm.TxManager.commit(TxManager.java:240)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
      at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:82)
      at org.jboss.jms.client.container.AsfAspect.handleRun(AsfAspect.java:165)
      at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:130)
      at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
      at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:134)
      at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
      at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
      at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
      at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
      at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
      at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
      at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
      at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
      at java.lang.Thread.run(Thread.java:595)

      Regards,
      Mark P Ashworth

        • 1. Re: Failed to remove delivery <messageId>
          Tim Fox Master

          Hi-

          We haven't tested against Derby so it's not one of our supported databases.

          However, if you have produced a persistence manager configuration for Derby then if you would like to contribute it we can put it through the test suite.

          So far we've tested against Oracle, Sybase, PostgreSQL, MSQL, MySQL

          • 2. Re: Failed to remove delivery <messageId>
            Mark P Ashworth Newbie

            Good Day,

            Thank you for the help. I have changed it back to use the HSQLDB DefaultDS datasource but now it gives a batch update error with now reason for the error.

            2006-06-21 14:18:01,500 ERROR [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] Exception occured
            java.sql.BatchUpdateException: failed batch
            at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)
            at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)
            at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:478)
            at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:517)
            at org.jboss.messaging.core.plugin.JDBCPersistenceManager.handleBeforeCommit1PC(JDBCPersistenceManager.java:2650)
            at org.jboss.messaging.core.plugin.JDBCPersistenceManager$TransactionCallback.beforeCommit(JDBCPersistenceManager.java:4331)
            at org.jboss.messaging.core.tx.Transaction.commit(Transaction.java:171)
            at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:390)
            at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:99)
            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 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
            at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
            at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
            at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:126)
            at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:842)
            at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:691)
            at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:443)
            at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:530)
            at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:253)
            2006-06-21 14:18:01,718 DEBUG [org.jboss.jms.server.connectionmanager.SimpleConnectionManager] unregistered connection ConnectionEndpoint[-2147483627] with remoting session ID ...-eopnjrb0-4

            For Derby I used the stock statements but changed the JMS_MESSAGE table to the following:

            CREATE TABLE JMS_MESSAGE (
            MESSAGEID BIGINT,
            RELIABLE CHAR(1),
            EXPIRATION BIGINT,
            TIMESTAMP BIGINT,
            PRIORITY INT,
            COREHEADERS LONG VARCHAR FOR BIT DATA,
            PAYLOAD LONG VARCHAR FOR BIT DATA,
            CHANNELCOUNT INTEGER,
            TYPE INT,
            JMSTYPE VARCHAR(255),
            CORRELATIONID VARCHAR(255),
            CORRELATIONID_BYTES VARCHAR(254) FOR BIT DATA,
            DESTINATION_ID BIGINT,
            REPLYTO_ID BIGINT,
            JMSPROPERTIES LONG VARCHAR FOR BIT DATA,
            REFERENCECOUNT INT,
            PRIMARY KEY (MESSAGEID));

            Hope it helps.

            Regards,
            Mark P Ashworth

            • 3. Re: Failed to remove delivery <messageId>
              Tim Fox Master

              Can try setting useBatchUpdates = false in the persistence config and try again?

              It should give you a more descriptive error message.

              Also, what version of JBoss AS are using, and what version of JBossMessaging are you using?

              • 4. Re: Failed to remove delivery <messageId>
                Mark P Ashworth Newbie

                Good Day,

                JBoss AS 4.0.4.GA
                JBoss Messaging 1.0.1 CR2

                The failed to remove `messageid` error also occurs when using the HSQLDB database under load (def. 10 threads sending 1000 messages each).

                2006-06-21 14:27:55,281 ERROR [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] Exception occured
                java.util.ConcurrentModificationException
                at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
                at java.util.AbstractList$Itr.next(AbstractList.java:420)
                at org.jboss.jms.server.endpoint.ServerConsumerEndpoint$DeliveryCallback.afterCommit(ServerConsumerEndpoint.java:717)
                at org.jboss.messaging.core.tx.Transaction.commit(Transaction.java:186)
                at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:390)
                at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:99)
                at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
                at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
                at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:126)
                at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:842)
                at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:82)
                at org.jboss.remoting.Client.invoke(Client.java:610)
                at org.jboss.remoting.Client.invoke(Client.java:602)
                at org.jboss.jms.client.delegate.DelegateSupport.invoke(DelegateSupport.java:112)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:134)
                at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)
                at org.jboss.jms.tx.ResourceManager.sendTransactionXA(ResourceManager.java:406)
                at org.jboss.jms.tx.ResourceManager.commit(ResourceManager.java:194)
                at org.jboss.jms.tx.MessagingXAResource.commit(MessagingXAResource.java:116)
                at org.jboss.tm.TransactionImpl$Resource.commit(TransactionImpl.java:2253)
                at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1784)
                at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:340)
                at org.jboss.tm.TxManager.commit(TxManager.java:240)
                at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
                at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:82)
                at org.jboss.jms.client.container.AsfAspect.handleRun(AsfAspect.java:165)
                at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:130)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:134)
                at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
                at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
                at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
                at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
                at java.lang.Thread.run(Thread.java:595)
                2006-06-21 14:27:55,296 INFO [com.x.EventMDB] Received event Id: -1
                2006-06-21 14:27:55,296 INFO [com.x.EventMDB] Received event Id: -1
                2006-06-21 14:27:55,328 INFO [com.x.EventMDB] Received event Id: -1
                2006-06-21 14:27:55,328 INFO [com.x.EventMDB] Received event Id: -1
                2006-06-21 14:27:55,328 INFO [com.x.EventMDB] Received event Id: -1
                2006-06-21 14:27:55,328 ERROR [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] Failed to rollback tx
                org.jboss.messaging.core.tx.TransactionException: Failed to remove delivery 18916
                at org.jboss.jms.server.endpoint.ServerConsumerEndpoint$DeliveryCallback.afterRollback(ServerConsumerEndpoint.java:739)
                at org.jboss.messaging.core.tx.Transaction.rollback(Transaction.java:256)
                at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:399)
                at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:99)
                at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
                at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
                at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:126)
                at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:842)
                at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:82)
                at org.jboss.remoting.Client.invoke(Client.java:610)
                at org.jboss.remoting.Client.invoke(Client.java:602)
                at org.jboss.jms.client.delegate.DelegateSupport.invoke(DelegateSupport.java:112)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:134)
                at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
                at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)
                at org.jboss.jms.tx.ResourceManager.sendTransactionXA(ResourceManager.java:406)
                at org.jboss.jms.tx.ResourceManager.commit(ResourceManager.java:194)
                at org.jboss.jms.tx.MessagingXAResource.commit(MessagingXAResource.java:116)
                at org.jboss.tm.TransactionImpl$Resource.commit(TransactionImpl.java:2253)
                at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1784)
                at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:340)
                at org.jboss.tm.TxManager.commit(TxManager.java:240)
                at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
                at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:82)
                at org.jboss.jms.client.container.AsfAspect.handleRun(AsfAspect.java:165)
                at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:130)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:134)
                at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
                at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
                at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
                at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
                at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
                at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
                at java.lang.Thread.run(Thread.java:595)

                • 5. Re: Failed to remove delivery <messageId>
                  Tim Fox Master

                  Can you send me some code to replicate this and I'll take a look...

                  Thx

                  • 6. Re: Failed to remove delivery <messageId>
                    Mark P Ashworth Newbie

                    There is an MDB listening for messages on queue/event and it just prints that it has received a message.

                    There is a client that is sending messages.


                    import java.util.Hashtable;

                    import javax.jms.Connection;
                    import javax.jms.DeliveryMode;
                    import javax.jms.MessageProducer;
                    import javax.jms.Queue;
                    import javax.jms.QueueConnectionFactory;
                    import javax.jms.Session;
                    import javax.jms.TextMessage;
                    import javax.naming.Context;
                    import javax.naming.InitialContext;

                    public class JBossMessagingMain {

                    public static void main(String[] args) throws Exception {
                    Hashtable env = new Hashtable();
                    env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
                    env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
                    env.put(Context.PROVIDER_URL, "localhost:1099");

                    Thread[] senders = new Thread[] {
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env)),
                    new Thread(new JBossMessageSender(env))
                    };

                    for (int i = 0; i < senders.length; i++) {
                    Thread thread = senders;
                    thread.start();
                    Thread.sleep(10);
                    }

                    }
                    }
                    class JBossMessageSender implements Runnable {
                    private Connection conn = null;
                    private Session session = null;
                    private MessageProducer sender = null;
                    private String msg = "Hello JBoss Messaging";

                    public JBossMessageSender(Hashtable env) throws Exception {

                    InitialContext context = new InitialContext(env);
                    QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup("/ConnectionFactory");
                    conn = qcf.createConnection();
                    session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

                    sender = session.createProducer((Queue) context.lookup("queue/event"));
                    }
                    public void run() {

                    try {
                    TextMessage message = session.createTextMessage(msg);
                    message.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
                    message.setJMSPriority(7);

                    for(int i = 0; i < 1000; i++) {
                    message.setText(msg);
                    sender.send(message);

                    message.clearBody();

                    if ((i % 10) == 0) {
                    //System.out.println("Comitting");
                    if (session.getTransacted()) {
                    session.commit();
                    }
                    Thread.sleep(1);
                    }
                    Thread.sleep(1);
                    }
                    if (session.getTransacted()) {
                    session.commit();
                    }
                    Thread.sleep(100);
                    } catch (Exception e) {
                    e.printStackTrace();
                    } finally {
                    try {session.close();} catch (Exception e1) {e1.printStackTrace();}
                    try {conn.close();} catch (Exception e1) {e1.printStackTrace();}
                    try {sender.close();} catch (Exception e1) {e1.printStackTrace();}
                    }
                    }
                    }


                    • 7. Re: Failed to remove delivery <messageId>
                      Tim Fox Master

                      What version of JBoss, JDK and Messaging are you running?

                      • 8. Re: Failed to remove delivery <messageId>
                        Mark P Ashworth Newbie

                        JBoss AS 4.0.4.GA
                        JBoss Messaging 1.0.1 CR2
                        JDK 5.0

                        • 9. Re: Failed to remove delivery <messageId>
                          Tim Fox Master

                          You say you are sending non persistent messages, but in your code you are sending persistent messages.

                          Can you explain what you are actually doing again, I am confused as to what your use case is....

                          Also your jms client exits without waiting to join the threads, so it will never work.....