(Fixed?) Updated - Help w/ Oracle JMS and AQjmsException (JMS-147)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

(Fixed?) Updated - Help w/ Oracle JMS and AQjmsException (JMS-147)

Seon Lee
This post was updated on .
Has anyone experienced this error while using Camel deployed into an OC4J container? I am encountering this exception while executing a route defined as:

        from("jms:queue:foo").multicast().to("jms:queue:bar", "jms:queue:blah")

Following is the stacktrace and the inbound message header key/values.

The stacktrace...

2008-06-18 14:19:25,187 [enerContainer-2] ERROR DeadLetterChannel              - Failed delivery for exchangeId: ID-VZ-SWL/4167-1213813164062/0-4. On delivery a
ttempt: 0 caught: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is oracle.jms.AQjms
Exception: JMS-147: Invalid ReplyTo destination type, or use of reserved `JMSReplyTo agent name, or serialization error with AQjmsDestination
org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is oracle.jms.AQjmsException: JMS-147
: Invalid ReplyTo destination type, or use of reserved `JMSReplyTo agent name, or serialization error with AQjmsDestination
        at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:289)
        at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
        at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:462)
        at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:535)
        at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:120)
        at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:57)
        at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:48)
        at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
        at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
        at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
        at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:66)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)

        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
        at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.jms.AQjmsException: JMS-147: Invalid ReplyTo destination type, or use of reserved `JMSReplyTo agent name, or serialization error with AQjmsDes
tination
        at oracle.jms.AQjmsError.throwEx(AQjmsError.java:285)
        at oracle.jms.AQjmsMessage.setJMSReplyTo(AQjmsMessage.java:523)
        at oracle.j2ee.ra.jms.generic.MessageWrapper.setJMSReplyTo(MessageWrapper.java:135)
        at org.apache.camel.component.jms.JmsBinding.appendJmsProperties(JmsBinding.java:157)
        at org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:127)
        at org.apache.camel.component.jms.JmsProducer$2.createMessage(JmsProducer.java:122)
        at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:557)
        at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:538)
        at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:459)
        ... 24 more


And the headers...

{JMS_OracleOriginalMessageID=null, JMS_OracleHeaderOnly=null, org.apache.camel.RedeliveryCounter=1, JMSType=sometype, JMSReplyTo=null, JMS_OracleConnectionID=null, JMSXState=0, JMS_OracleTimestamp=1213813165109, JMSDestination=oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl[foo], JMSRedelivered=false, JMSDeliveryMode=2, JMSMessageID=ID:C98CD9B72DE043A187907C4E7EDED473, JMSCorrelationID=null, JMSXDeliveryCount=1, JMSTimestamp=1213813165109, JMSXGroupSeq=null, JMS_OracleDelay=0, JMS_OracleDeliveryMode=2, JMSXGroupID=null, JMS_OracleExcpQ=null, JMSExpiration=0, JMSXUserID=JMSUSER, JMSXRecvTimestamp=1213813165140, org.apache.camel.Redelivered=true, JMSXAppID=null, JMSPriority=1}
Reply | Threaded
Open this post in threaded view
|

Re: Help w/ Oracle JMS and AQjmsException (JMS-147)

Seon Lee
I've found a fix for this, but the underlying cause seems to be the implementation of Message.setRepyTo()  inside the Oracle JMS package. Specifically, it seems to puke on "null" values for the Destination parameter.

I modified the class org.apache.camel.component.jms.JmsBinding @ line 156 in method appendJmsProperties() to perform a null check on the header value before attempting to set the replyTo property.

                else if (headerName.equals("JMSReplyTo") && headerValue != null) {
                    jmsMessage.setJMSReplyTo(ExchangeHelper.convertToType(exchange,Destination.class, headerValue));

                }

There might be adverse side-effects with outright ignoring the JMSReplyTo property in this manner, however.


Additionally, while debugging this problem I've discovered what seems to be a typo/error in Oracle's JMS package. It seems they are not following the JMS 1.1 spec per the JMSX property named "JMSXRcvTimestamp"; they've actually named it "JMSXRecvTimestamp" (with an 'e'). This is causing a subtle error to occur when using the camel JMS component with an Oracle AQ.

I also patched this by modifying the method JmsBinding.populateIgnoreJmsHeaders() -- adding an additional ignore string for the Oracle typo "JMSXRecvTimestamp".

Once I made these two changes, multicasting is working properly with Oracle AQ queues.


If the devs are interested I will open a JIRA and upload diff patch files against 1.3.0. I wanted to make sure though that I posted here to see if anyone else ran into a similar problem and had a better solution -- or perhaps I am way off-target and this is not a bug.

Cheers!
Seon
Reply | Threaded
Open this post in threaded view
|

Re: Help w/ Oracle JMS and AQjmsException (JMS-147)

Seon Lee
In reply to this post by Seon Lee
By the way, does anyone know where/if Oracle source code is available for their JMS package?
Reply | Threaded
Open this post in threaded view
|

RE: Help w/ Oracle JMS and AQjmsException (JMS-147)

Claus Ibsen
In reply to this post by Seon Lee
Hi Sean

Yes by all means please open a JIRA ticket and submit your patches and a link to this forum thread from eg. nabble.

We are closing in on a 1.4 release and it would be good to include your fixes for the Oracle JMS.

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Seon Lee [mailto:[hidden email]]
Sent: 18. juni 2008 23:36
To: [hidden email]
Subject: Re: Help w/ Oracle JMS and AQjmsException (JMS-147)


I've found a fix for this, but the underlying cause seems to be the
implementation of Message.setRepyTo()  inside the Oracle JMS package.
Specifically, it seems to puke on "null" values for the Destination
parameter.

I modified the class org.apache.camel.component.jms.JmsBinding @ line 156 in
method appendJmsProperties() to perform a null check on the header value
before attempting to set the replyTo property.

                else if (headerName.equals("JMSReplyTo") && headerValue !=
null) {
                   
jmsMessage.setJMSReplyTo(ExchangeHelper.convertToType(exchange,Destination.class,
headerValue));

                }

There might be adverse side-effects with outright ignoring the JMSReplyTo
property in this manner, however.


Additionally, while debugging this problem I've discovered what seems to be
a typo/error in Oracle's JMS package. It seems they are not following the
JMS 1.1 spec per the JMSX property named "JMSXRcvTimestamp"; they've
actually named it "JMSXRecvTimestamp" (with an 'e'). This is causing a
subtle error to occur when using the camel JMS component with an Oracle AQ.

I also patched this by modifying the method
JmsBinding.populateIgnoreJmsHeaders() -- adding an additional ignore string
for the Oracle typo "JMSXRecvTimestamp".

Once I made these two changes, multicasting is working properly with Oracle
AQ queues.


If the devs are interested I will open a JIRA and upload diff patch files
against 1.3.0. I wanted to make sure though that I posted here to see if
anyone else ran into a similar problem and had a better solution -- or
perhaps I am way off-target and this is not a bug.

Cheers!
Seon
--
View this message in context: http://www.nabble.com/Help-w--Oracle-JMS-and-AQjmsException-%28JMS-147%29-tp17989368s22882p17992426.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

RE: Help w/ Oracle JMS and AQjmsException (JMS-147)

Seon Lee
I've opened a new issue and attached a diff patch for review.

https://issues.apache.org/activemq/browse/CAMEL-618

Cheers!
Seon

Claus Ibsen wrote
Hi Sean

Yes by all means please open a JIRA ticket and submit your patches and a link to this forum thread from eg. nabble.

We are closing in on a 1.4 release and it would be good to include your fixes for the Oracle JMS.

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk