2 Replies Latest reply on Oct 2, 2007 7:48 AM by Adrian Brock

    Joram Test failling on Selector JMSDEliveryMode

    Clebert Suconic Master

      I have this failing testcase (copied from JORAM Test):

       public void testJMSDeliveryModeInSelector()
       {
       try
       {
       receiver = receiverSession.createReceiver(receiverQueue, "JMSDeliveryMode = 2");
       receiverConnection.start();
      
       TextMessage dummyMessage = senderSession.createTextMessage();
       dummyMessage.setText("testJMSDeliveryModeInSelector:1");
       // send a dummy message in *non persistent* mode
       sender.send(dummyMessage, DeliveryMode.NON_PERSISTENT, sender.getPriority(), sender.getTimeToLive());
      
       TextMessage message = senderSession.createTextMessage();
       message.setText("testJMSDeliveryModeInSelector:2");
       // send a message in *persistent*
       sender.send(message, DeliveryMode.PERSISTENT, sender.getPriority(), sender.getTimeToLive());
      
       TextMessage msg = (TextMessage)
      receiver.receive(TestConfig.TIMEOUT);
       assertTrue("No message was received", msg != null); // <<< test fails here
       // only the message sent in persistent mode should be received.
       assertEquals(DeliveryMode.PERSISTENT, msg.getJMSDeliveryMode());
       assertEquals("testJMSDeliveryModeInSelector:2", msg.getText());
       }
       catch (JMSException e)
       {
       fail(e);
       }
       }
      


      The test fails on the assertion I highlighted on the code above.

      On server logs you will see this:

      java.lang.Exception: Bad Object: expected 'String' got 'Long' for operation: 0:EQUAL(
       Identifier@JMSDeliveryMode
       2
      )
      
       at org.jboss.mq.selectors.Operator.throwBadObjectException(Operator.java:981)
       at org.jboss.mq.selectors.Operator.equal(Operator.java:215)
       at org.jboss.mq.selectors.Operator.apply(Operator.java:917)
       at org.jboss.mq.selectors.Selector.test(Selector.java:168)
       at org.jboss.mq.Subscription.accepts(Subscription.java:109)
       at org.jboss.mq.server.BasicQueue.receive(BasicQueue.java:683)
       at org.jboss.mq.server.JMSQueue.receive(JMSQueue.java:185)
       at org.jboss.mq.server.ClientConsumer.receive(ClientConsumer.java:228)
       at org.jboss.mq.server.JMSDestinationManager.receive(JMSDestinationManager.java:604)
       at org.jboss.mq.server.JMSServerInterceptorSupport.receive(JMSServerInterceptorSupport.java:141)
       at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurityInterceptor.java:115)
       at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.java:450)
       at org.jboss.mq.server.JMSServerInvoker.receive(JMSServerInvoker.java:147)
       at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:177)
       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)
      17:26:28,170 WARN [Selector] Invalid selector: JMSDeliveryMode = 2
      java.lang.Exception: Bad Object: expected 'String' got 'Long' for operation: 0:EQUAL(
       Identifier@JMSDeliveryMode
       2
      )
      
       at org.jboss.mq.selectors.Operator.throwBadObjectException(Operator.java:981)
       at org.jboss.mq.selectors.Operator.equal(Operator.java:215)
       at org.jboss.mq.selectors.Operator.apply(Operator.java:917)
       at org.jboss.mq.selectors.Selector.test(Selector.java:168)
       at org.jboss.mq.Subscription.accepts(Subscription.java:109)
       at org.jboss.mq.server.BasicQueue.receive(BasicQueue.java:683)
       at org.jboss.mq.server.JMSQueue.receive(JMSQueue.java:185)
       at org.jboss.mq.server.ClientConsumer.receive(ClientConsumer.java:228)
       at org.jboss.mq.server.JMSDestinationManager.receive(JMSDestinationManager.java:604)
       at org.jboss.mq.server.JMSServerInterceptorSupport.receive(JMSServerInterceptorSupport.java:141)
       at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurityInterceptor.java:115)
       at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.java:450)
       at org.jboss.mq.server.JMSServerInvoker.receive(JMSServerInvoker.java:147)
       at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:177)
       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)
      



      My knowledge of MQ codebase is enough just to determine this looks a real issue. The same test will pass on JBoss Messaging.