3 Replies Latest reply on May 23, 2007 6:22 PM by timfox

    Invalid Selector

    macross27

      Hi all,

      I got following error with JBoss messaging:

      15:29:00,896 WARN [Selector] Invalid selector: JMSCorrelationID=1179926940029
      java.lang.Exception: Bad Object: expected 'String' got 'Long' for operation: 0:EQUAL(
       Identifier@JMSCorrelationID
       1179926940029
      )
      
       at org.jboss.jms.selector.Operator.throwBadObjectException(Operator.java:980)
       at org.jboss.jms.selector.Operator.equal(Operator.java:214)
       at org.jboss.jms.selector.Operator.apply(Operator.java:916)
       at org.jboss.jms.selector.Selector.accept(Selector.java:168)
       at org.jboss.jms.server.endpoint.ServerConsumerEndpoint.accept(ServerConsumerEndpoint.java:347)
       at org.jboss.jms.server.endpoint.ServerConsumerEndpoint.handle(ServerConsumerEndpoint.java:233)
       at org.jboss.messaging.core.local.RoundRobinPointToPointRouter.handle(RoundRobinPointToPointRouter.java:120)
       at org.jboss.messaging.core.ChannelSupport.deliverInternal(ChannelSupport.java:600)
       at org.jboss.messaging.core.ChannelSupport.deliver(ChannelSupport.java:306)
       at org.jboss.jms.server.endpoint.ServerSessionEndpoint$2.run(ServerSessionEndpoint.java:952)
       at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)
       at java.lang.Thread.run(Thread.java:595)
      


      If I'm not wrong, apparently the attached systems tries to retrieve a message via a JMSCorrelationID which is not a string but a long. Is there a possibility to make this work? Of course I can't do anything in the source code of this attached ERP system.

      Thanks for your help...

      Sebastian

        • 1. Re: Invalid Selector
          timfox

          How about adding quotes to your selector?

          JMSCorrelationID='1179926940029'
          


          BTW are you sure you want to be be using selectors for something as dynamic as correlation ids? Setting a consumer with a selector is likely to be a fairly slow operation (compared to sending/receiving a message) and probably not something you want to do to implement a request/response pattern.

          Have you considered using temporary queues instead?

          • 2. Re: Invalid Selector
            macross27

            Thanks for the tip. However I can't do anything on the side of the application which uses the odd correlation id or the selector as it is closed source. So I have to deal with that in JBoss messaging. Any ideas to that?

            I guess that the correlation id is a string is part of Sun's JMS spec?

            • 3. Re: Invalid Selector
              timfox

               

              "macross27" wrote:
              Thanks for the tip. However I can't do anything on the side of the application which uses the odd correlation id or the selector as it is closed source. So I have to deal with that in JBoss messaging. Any ideas to that?


              The selector is invalid, you need to fix your application - this is not a JBM issue.


              I guess that the correlation id is a string is part of Sun's JMS spec?


              Yes, http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/javax/jms/Message.html#getJMSCorrelationID()