javax.jms.InvalidSelectorException when calling javax.jms.QueueSession.createBrowser() in weblogic12c

2.2k Views Asked by At

after upgrading Weblogic version from 10.3.6 to 12.1.2 i get javax.jms.InvalidSelectorException

when calling JMS API

javax.jms.QueueSession.createBrowser(Queue queue, String messageSelector)

the selector i'm using is

String selector = "JMSTimestamp < " + timeStamp + " AND JMSRedelivered = false";

does anyone knows what can cause the issue ? what am i missing ?

Not sure why it worked on WL10.3.6 and on WL12 its not (didn't change the code)

javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JMSTimestamp < 1386059460109 AND JMSRedelivered = false"
        at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:110)
        at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:45)
        at weblogic.jms.client.JMSSession.createBackEndBrowser(JMSSession.java:3278)
        at weblogic.jms.client.JMSQueueBrowser.<init>(JMSQueueBrowser.java:48)
        at weblogic.jms.client.JMSSession.createBrowser(JMSSession.java:2671)
        at weblogic.jms.client.WLSessionImpl.createBrowser(WLSessionImpl.java:1072)
        at my.common.server.jms.JMSBrowser.initBrowser(JMSBrowser.java:87)
        at my.common.server.jms.JMSBrowser.countOldMessages(JMSBrowser.java:53)
        at my.callback.server.JMSCallbackBrowseSyncTimeoutTask.execute(JMSCallbackBrowseSyncTimeoutTask.java:36)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JMSTimestamp < 1386059460109 AND JMSRedelivered = false"
        at weblogic.jms.dispatcher.Request.handleThrowable(Request.java:87)
        at weblogic.jms.dispatcher.Request.getResult(Request.java:52)
        at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:1124)
        at weblogic.messaging.dispatcher.DispatcherImpl.syncRequest(DispatcherImpl.java:201)
        at weblogic.messaging.dispatcher.DispatcherImpl.dispatchSync(DispatcherImpl.java:236)
        at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:43)
        ... 9 more
Caused by: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JMSTimestamp < 1386059460109 AND JMSRedelivered = false"
        at weblogic.jms.dispatcher.Request.handleThrowable(Request.java:87)
        at weblogic.jms.dispatcher.Request.getResult(Request.java:52)
        at weblogic.jms.dispatcher.Request.useChildResult(Request.java:69)
        at weblogic.jms.frontend.FESession.browserCreate(FESession.java:1288)
        at weblogic.jms.frontend.FESession.invoke(FESession.java:3041)
        at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:961)
        ... 12 more
Caused by: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JMSTimestamp < 1386059460109 AND JMSRedelivered = false"
        at weblogic.jms.dispatcher.Request.handleThrowable(Request.java:87)
        at weblogic.jms.dispatcher.Request.getResult(Request.java:52)
        at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:1124)
        at weblogic.messaging.dispatcher.DispatcherImpl.dispatchAsyncInternal(DispatcherImpl.java:156)
        at weblogic.messaging.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:132)
        at weblogic.messaging.dispatcher.Request.dispatchAsync(Request.java:1303)
        at weblogic.jms.dispatcher.Request.dispatchAsync(Request.java:96)
        at weblogic.jms.frontend.FESession.browserCreate(FESession.java:1275)
        ... 14 more
Caused by: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JMSTimestamp < 1386059460109 AND JMSRedelivered = false"
        at weblogic.jms.backend.BEBrowserImpl.<init>(BEBrowserImpl.java:85)
        at weblogic.jms.backend.BEQueueImpl.createBrowser(BEQueueImpl.java:251)
        at weblogic.jms.backend.BESessionImpl.createBrowser(BESessionImpl.java:877)
        at weblogic.jms.backend.BESessionImpl.invoke(BESessionImpl.java:279)
        at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:961)
2

There are 2 best solutions below

0
On

after a lot of investigations we saw that we had a configuration which we used in weblogic 10.3.6 , we configured for the classloader the specific antlr.jar instead of the implemented version in WL

weblogic-application.xml contained :

<prefer-application-packages>
        <package-name>antlr.*</package-name>
    </prefer-application-packages>
0
On

Both the hibernate and drools package contains this antlr jar. You have to exclude the antlr package and use the one weblogic provided.