diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-23 10:40:56 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-23 10:40:56 +0000 |
commit | d409ec37565759085846a1b0959d94dfe767848c (patch) | |
tree | 696147b4cdfa82fadf809846ea80e2321b7169a4 /sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml | |
parent | 111c7ec0e7af072488134e06f0506884abd716dd (diff) |
Update jms wireformats to fix NPE with async services
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1160610 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/runtime/WireFormatJMSTextXMLServiceInterceptor.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/runtime/WireFormatJMSTextXMLServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/runtime/WireFormatJMSTextXMLServiceInterceptor.java index d914bd9e2e..7766469271 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/runtime/WireFormatJMSTextXMLServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/runtime/WireFormatJMSTextXMLServiceInterceptor.java @@ -93,6 +93,12 @@ public class WireFormatJMSTextXMLServiceInterceptor extends InterceptorAsyncImpl // get the jms context JMSBindingContext context = msg.getBindingContext(); + // The Binding Context may be null on an asynchronous response - in which case, create a new one + if(context == null) { + context = createBindingContext(); + msg.setBindingContext(context); + } + Session session = context.getJmsResponseSession(); javax.jms.Message responseJMSMsg; @@ -114,6 +120,12 @@ public class WireFormatJMSTextXMLServiceInterceptor extends InterceptorAsyncImpl public void setNext(Invoker next) { this.next = next; } + + private JMSBindingContext createBindingContext() { + JMSBindingContext context = new JMSBindingContext(); + context.setJmsResourceFactory(jmsResourceFactory); + return context; + } public Message processRequest(Message msg) { return invokeRequest(msg); |