You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Davanum Srinivas <di...@yahoo.com> on 2001/10/04 18:42:31 UTC
Updated Patch for Context Class Loader problems
Hi Team,
Here's an updated patch for the Class Loader problems (after a brief chat on IRC with Glen & Sam).
Thanks,
dims
--------------------------------------- CUT HERE
-------------------------------------------------Index: AxisServlet.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
retrieving revision 1.50
diff -u -r1.50 AxisServlet.java
--- AxisServlet.java 2001/10/04 14:36:50 1.50
+++ AxisServlet.java 2001/10/04 16:35:28
@@ -96,6 +96,15 @@
private static final String AXIS_ENGINE = "AxisEngine" ;
public void init() {
+ /*
+ * HACK: Some Servlet Engines have bad Context Class Loader (Like Tomcat3.2.3)
+ * Since by definition, The Class Loader that loaded this Servlet should be
+ * the Context Class Loader, We set the Context Class Loader explicity.
+ */
+ try {
+ Thread.currentThread().setContextClassLoader(AxisServlet.class.getClassLoader());
+ } catch (Exception e){}
+
String param = getInitParameter("transport.name");
ServletContext context = getServletConfig().getServletContext();
@@ -108,6 +117,20 @@
if ((param != null) && (param.equalsIgnoreCase("true"))) {
securityProvider = new ServletSecurityProvider();
}
+ }
+
+ public void service(HttpServletRequest req, HttpServletResponse res)
+ throws ServletException, IOException {
+ /*
+ * HACK: Some Servlet Engines have bad Context Class Loader (Like Tomcat3.2.3)
+ * Since by definition, The Class Loader that loaded this Servlet should be
+ * the Context Class Loader, We set the Context Class Loader explicity.
+ */
+ try {
+ Thread.currentThread().setContextClassLoader(AxisServlet.class.getClassLoader());
+ } catch (Exception e){}
+
+ super.service(req,res);
}
public AxisServer getEngine() {
--------------------------------------- CUT HERE -------------------------------------------------
=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI
__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1