Author: asoldano
Date: 2013-11-07 04:48:04 -0500 (Thu, 07 Nov 2013)
New Revision: 18066
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java
Log:
[JBWS-3729] free the thread default bus association in the current thread which is serving
the servlet init
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java 2013-11-06
17:10:16 UTC (rev 18065)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java 2013-11-07
09:48:04 UTC (rev 18066)
@@ -24,7 +24,6 @@
import javax.servlet.ServletConfig;
import javax.xml.ws.Endpoint;
-import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
@@ -39,8 +38,13 @@
super.loadBus(servletConfig);
// You could add the endpoint publish codes here
- Bus bus = getBus();
- BusFactory.setThreadDefaultBus(bus);
- Endpoint.publish("/Echo1", new EchoImpl());
+ try {
+ Endpoint.publish("/Echo1", new EchoImpl());
+ } finally {
+ //free the thread default bus association in the current thread which
+ //is serving the servlet init, as it can have side effect on other
+ //servlet(s) deployed afterwards
+ BusFactory.setThreadDefaultBus(null);
+ }
}
}