[jbossws-commits] JBossWS SVN: r3801 - branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Jul 5 09:07:52 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-05 09:07:51 -0400 (Thu, 05 Jul 2007)
New Revision: 3801

Modified:
   branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
Log:
Set the context class loader for handleRequest

Modified: branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java	2007-07-04 20:16:18 UTC (rev 3800)
+++ branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java	2007-07-05 13:07:51 UTC (rev 3801)
@@ -163,6 +163,14 @@
 
       ServletInputStream in = req.getInputStream();
       ServletOutputStream out = res.getOutputStream();
+
+      ClassLoader classLoader = endpoint.getService().getDeployment().getClassLoader();
+      if (classLoader == null)
+         throw new IllegalStateException("Deployment has no classloader associated");
+      
+      // Set the thread context class loader
+      ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+      Thread.currentThread().setContextClassLoader(classLoader);
       try
       {
          ServletRequestContext reqContext = new ServletRequestContext(context, req, res);
@@ -174,6 +182,9 @@
       }
       finally
       {
+         // Reset the thread context class loader
+         Thread.currentThread().setContextClassLoader(ctxClassLoader);
+         
          try
          {
             out.close();




More information about the jbossws-commits mailing list