[ 
https://issues.apache.org/activemq/browse/AMQ-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44233#action_44233
 ] 

Guy Veraghtert commented on AMQ-1551:
-------------------------------------

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


> ActiveMQ as foreign JMS provider to BEA WLS 8.1/10
> --------------------------------------------------
>
>                 Key: AMQ-1551
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1551
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.1
>         Environment: BEA WLS 8.1/10
> SuSE SLES 9
>            Reporter: Christian Burger
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to