Author: asoldano
Date: 2013-11-04 09:51:18 -0500 (Mon, 04 Nov 2013)
New Revision: 18058
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
Be sure the thread default bus is in synch with the specified bus while creating the
service
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-04
05:11:17 UTC (rev 18057)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-04
14:51:18 UTC (rev 18058)
@@ -222,10 +222,18 @@
else if (NEW_BUS_STRATEGY.equals(strategy))
{
bus = new JBossWSBusFactory().createBus();
+ //to prevent issues with CXF code using the default thread bus instead of the
one returned here,
+ //set the new bus as thread one, given the line above could have not done this
if the current
+ //thread is already assigned a bus
+ BusFactory.setThreadDefaultBus(bus);
}
else if (TCCL_BUS_STRATEGY.equals(strategy))
{
bus = JBossWSBusFactory.getClassLoaderDefaultBus(threadContextClassLoader);
+ //to prevent issues with CXF code using the default thread bus instead of the
one returned here,
+ //set the bus as thread one, given the line above could have not done this if we
already had a
+ //bus for the classloader and hence we did not create a new one
+ BusFactory.setThreadDefaultBus(bus);
}
return bus;
}