Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 17:02:52 -0400 (Thu, 06 Oct 2011)
New Revision: 11487
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
Log:
Back porting HORNETQ-681
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-06
21:01:08 UTC (rev 11486)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-06
21:02:52 UTC (rev 11487)
@@ -54,6 +54,7 @@
import org.hornetq.jms.bridge.QualityOfServiceMode;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.HornetQSession;
+import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -942,10 +943,8 @@
{
try
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class aClass = loader.loadClass(transactionManagerLocatorClass);
- Object o = aClass.newInstance();
- Method m = aClass.getMethod(transactionManagerLocatorMethod);
+ Object o =
ClassloadingUtil.safeInitNewInstance(transactionManagerLocatorClass);
+ Method m = o.getClass().getMethod(transactionManagerLocatorMethod);
tm = (TransactionManager)m.invoke(o);
}
catch (Exception e)