diff --git a/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java b/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java index 1cdad827b..287af6f0c 100644 --- a/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java +++ b/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java @@ -50,6 +50,7 @@ public class CXFServletExt extends AbstractHTTPServlet implements ServletDelegate { private static final long serialVersionUID = -1820187716558491952L; + private ClassLoader delegateClassLoader; protected Endpoint endpoint; protected Bus bus; @@ -57,6 +58,8 @@ public class CXFServletExt extends AbstractHTTPServlet implements ServletDelegat public void init(ServletConfig sc) throws ServletException { super.init(sc); loadBus(sc); + delegateClassLoader = SecurityActions.createDelegateClassLoader(SecurityActions.getContextClassLoader(), + CXFServletExt.class.getClassLoader()); } protected void loadBus(ServletConfig servletConfig) throws ServletException @@ -157,7 +160,7 @@ protected Bus getBus() private ClassLoader pushServerCL() { ClassLoader current = SecurityActions.getContextClassLoader(); - SecurityActions.setContextClassLoader(SecurityActions.createDelegateClassLoader(current, CXFServletExt.class.getClassLoader())); + SecurityActions.setContextClassLoader(this.delegateClassLoader); return current; }