History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1551
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Christian Burger
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

ActiveMQ as foreign JMS provider to BEA WLS 8.1/10

Created: 17/Jan/08 12:15 AM   Updated: 12/Jul/08 11:40 AM
Component/s: None
Affects Version/s: 4.1.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
BEA WLS 8.1/10
SuSE SLES 9


 Description  « Hide
During evaluation of ActiveMQ we found incompatibilties´of MQ with BEA WLS 8.1 and WLS 10. We contacted the BEA support - they where investigating and pinpointed the problem:

Hello ,

This is regarding your support case ABCDEF titled Need help in configuring message bridge with ActiveMQ. Here I am with the response from the next level of support team on the following NullPointerException that I am getting while configuring a message bridge with WLS. It is observed that even other customers are also observing the same exception while configuring a message bridge with ActiveMQ.

<AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1197983909603> <BEA-000000> <Exception:
javax.jms.JMSException: java.lang.NullPointerException
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:46)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1181)
at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1551)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:465)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:356)
at weblogic.jms.adapter.JMSBaseConnection.sendInternal(JMSBaseConnection.java:794)
at weblogic.jms.adapter.JMSBaseConnection.access$200(JMSBaseConnection.java:84)
at weblogic.jms.adapter.JMSBaseConnection$6.run(JMSBaseConnection.java:707)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.jms.adapter.JMSBaseConnection.send(JMSBaseConnection.java:704)

It is confirmed that this is not an issue with WLS, but Active MQ not setting the JMS Destination after the message is sent. As per the JMS specification, it states that the JMSDestination should be set AFTER the message is sent. In the case of a client contacting weblogic, this should be the wlclient.jar classes, as these are used to handle the connection; in the case of wls -> wls via messaging bridge, it will still be the same classes, although these will embedded within the JMS server.

In the case of WLS -> ActiveMQ via a messaging bridge, the messaging bridge will create a connection to ActiveMQ using the ActiveMQ client classes. The messaging bridge won't be able to set the JMSDestination, because it can't be done after the message is sent. It can be done by either the ActiveMQ client classes or the ActiveMQ JMS server, becasue these will handle the post send method methods.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Hiram Chirino - 16/May/08 10:37 AM
Just took a quick peek at what 5.1.0 does and it does set the destination on the message by the time the send() method returns. But I'm pretty sure we also did that for 4.1

Could you attach a junit test case demonstrating the failure your reporting. Thanks.


Guy Veraghtert - 12/Jul/08 11:40 AM
My findings after some debugging:

The send method in ActiveMQSession sets the incoming ActiveMQDestination on the incoming javax.jms.Message, in my case this message was of type weblogic.jms.common.TextMessageImpl. The imlementation of the setJMSDestination() method on this class (in fact on the superclass weblogic.jms.common.MessageImpl) doesn't set the destination if it isn't an instance of a implementation specific weblogic Destination. So after executing the setJMSDestination(), getJMSDestination() on the incoming message still returns null.

Later on in the send method, the weblogic specific message is transformed into an ActiveMQMessage via ActiveMQMessageTransformation.transformMessage(message, connection); This static method uses getJMSDestination() (returning null) on the orginal weblogic message to create an activemq version of the destination: activeMessage.setJMSDestination(transformDestination(message.getJMSDestination()));

A simple fix to support (amongst others) WLS bridging would be to set the destination after the message was transformed:

ActiveMQMessage msg = ActiveMQMessageTransformation.transformMessage(message, connection);
//for WebLogic
if(msg.getJMSDestination() == null) { msg.setJMSDestination(destination); }

Probably this would also solve issue: https://issues.apache.org/activemq/browse/AMQ-1217