You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Nicolás Lichtmaier <ni...@technisys.com.ar> on 2000/12/13 03:09:45 UTC

Reunning separate instances of Cocoon in the same JVM (patch)

And finally, the last patch!

The idea is to add the Apache JServ zone file a new property, that will override
the "extra classpath" that is prepended to the system one.

So setting:

servlet.org.apache.cocoon.Cocoon.initArgs=processor.xsp.localclasspath=/home/nic
k/src/java:/home/nick/src/xml-cocoon/build/classes:/usr/local/share/java/fop_0_1
3_0.jar:/usr/local/share/java/xerces_1_2.jar:/usr/local/share/java/xalan_1_2_D02
.jar:/usr/local/share/java/xml.jar:/usr/local/share/java/turbine-pool.jar

... I can now make all the people work in the same JVM+Apache+JServ with
different Cocoons (maybe different versions), and different classpaths.

I havem't tested this extensively, there might be other places that access systemn
properties.. I don't know...

Index: XSPProcessor.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java,v
retrieving revision 1.33
diff -u -r1.33 XSPProcessor.java
--- XSPProcessor.java	2000/12/01 23:36:44	1.33
+++ XSPProcessor.java	2000/12/13 02:02:20
@@ -214,11 +214,15 @@
     // Languages other than Java may also need to use the classpath to link to Java code
     // Try to get the classpath from catalina or tomcat first; if that fails use the
     // standard one.
-    String classpath = (String) 
-      this.servletContext.getAttribute("org.apache.catalina.jsp_classpath");
+    String classpath = (String) conf.get("localclasspath");
+    System.err.println("conf="+conf);
     if (classpath == null) {
-      classpath = (String)
-        this.servletContext.getAttribute("org.apache.tomcat.jsp_classpath");
+	classpath = (String)
+	 this.servletContext.getAttribute("org.apache.catalina.jsp_classpath");
+	if (classpath == null) {
+	    classpath = (String)
+	     this.servletContext.getAttribute("org.apache.tomcat.jsp_classpath");
+	}
     }
     if (classpath == null) 
       classpath = "";