Hi,

I and Anjana were trying for a JMS distributed transaction support scenario
with ESB 4.6.0, but we have noticed an issue in getting UserTransaction
from the JNDI name(when provided with transport.UserTxnJNDIName or with the
default value). We managed to apply a quick fix to this problem by
modifying axis2-transport-jms-1.1.0-wso2v7. Diff is attached here. Please
have a look on this issue.

-- 
Regards,

Inosh Goonewardena
Associate Technical Lead- WSO2 Inc.
Mobile: +94779966317
Index: src/main/java/org/apache/axis2/transport/jms/ServiceTaskManager.java
===================================================================
--- src/main/java/org/apache/axis2/transport/jms/ServiceTaskManager.java        
(revision 151870)
+++ src/main/java/org/apache/axis2/transport/jms/ServiceTaskManager.java        
(working copy)
@@ -943,32 +943,31 @@
      * @return The UserTransaction to be used, looked up from the JNDI
      */
     private UserTransaction getUserTransaction() {
+        Context context = null;
         if (!cacheUserTransaction) {
             if (log.isDebugEnabled()) {
                 log.debug("Acquiring a new UserTransaction for service : " + 
serviceName);
             }
 
             try {
-                context = getInitialContext();
+                context = new InitialContext();
                 return
                     JMSUtils.lookup(context, UserTransaction.class, 
getUserTransactionJNDIName());
             } catch (NamingException e) {
-                handleException("Error looking up UserTransaction : " + 
getUserTransactionJNDIName() +
-                    " using JNDI properties : " + jmsProperties, e);
+                handleException("Error looking up UserTransaction : " + 
getUserTransactionJNDIName(), e);
             }
         }
         
         if (sharedUserTransaction == null) {
             try {
-                context = getInitialContext();
+                context = new InitialContext();
                 sharedUserTransaction =
                     JMSUtils.lookup(context, UserTransaction.class, 
getUserTransactionJNDIName());
                 if (log.isDebugEnabled()) {
                     log.debug("Acquired shared UserTransaction for service : " 
+ serviceName);
                 }
             } catch (NamingException e) {
-                handleException("Error looking up UserTransaction : " + 
getUserTransactionJNDIName() +
-                    " using JNDI properties : " + jmsProperties, e);
+                handleException("Error looking up UserTransaction : " + 
getUserTransactionJNDIName(), e);
             }
         }
         return sharedUserTransaction;
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to