[EMAIL PROTECTED] wrote:

><SNIP/>
>
>
>Well, CatalinaService is not 'completed' - just started :-)
>
>What we do in 3.3 is have 2 setters, and at execute check if:
>- if only one is set, the other takes this value
>- if none is set, use discovery ( locate the base from the CLASSPATH )
>- if both are set, use that.
>
>If you want to implement this - great, if not I'll do it when I find 
>time ( or I need it ).
>
See attached patch. I added a method setHomeAndBase() and a couple of 
booleans to see if they were set via setters.

>
>>The next problem was that the task runs in VM. Ant's xercesImpl chokes 
>>on parsing the schemas. This is the known dependency on Xerces 2.0.1. 
>>Replacing the xercesImpl.jar in Ant fixed that, but that seems an ugly 
>>requirement.
>>
>
>Well... As I said, it is a major problem if we can't use any JAXP but 
>require a specific parser and version...
>
>One solution is to remove schema validation ( and validation in general )
>from tomcat runtime, and have a separate validation program that
>can be run on a webapp _before_ it is deployed on tomcat. 
>
>There are many other solutions - but requiring anyone using tomcat5
>to use Xerces2.0.1 and subjecting every user to hugely expensive
>and redundant validation is the worse.
>
With any luck, by the time Tomcat5 is released, XML parsers with good 
schema support will be more common, so it won't be such an issue. It is 
unfortunate that the current release of Xerces is broken.

Removing validation from the servlet container reference implementation 
somehow seems, well, wrong. I agree that doing validation at deployment 
is reasonable, rather than for each startup. Something like what the jsp 
compiler does.

>
><SNIP>
>
<java fork="false"> will run it in process, which gives problems with 
the shared environment. In particular I get:
     [java] INFO: Digester for server.xml created 587
     [java] java.lang.LinkageError: loader constraints violated when 
linking org/xml/sax/XMLReader class

<java fork="true"> will run it out of process, but the next task won't 
execute until tomcat finishes. Not good either.

I think the right answer is either Launcher, which uses [daemon] to 
start a background process, or Cactus, which introduces another 
dependency, and may still have some issues with the ant environment 
leaking through.

>
>
>Regarding output redirection, I think Patrick mentioned adding some
>methods in the startup code to redirect programmatically.
>
>Costin
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


Index: catalina/src/share/org/apache/catalina/startup/CatalinaService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
retrieving revision 1.2
diff -u -w -r1.2 CatalinaService.java
--- catalina/src/share/org/apache/catalina/startup/CatalinaService.java 10 Aug 2002 
16:54:15 -0000      1.2
+++ catalina/src/share/org/apache/catalina/startup/CatalinaService.java 14 Aug 2002 
+21:39:39 -0000
@@ -158,11 +158,34 @@
 
     }
 
+    private boolean homeSet = false;
+    private boolean baseSet = false;
+  
     public void setHome( String s ) {
         System.setProperty("catalina.home", s );
+        homeSet = true;
+    }
+  
+    public void setBase( String s ) {
         System.setProperty("catalina.base", s );
+        baseSet = true;
     }
     
+
+    protected void setupBaseAndHome() {
+        if (homeSet && baseSet) return;
+        if (!homeSet && !baseSet) return;
+        if (homeSet && !baseSet) {
+            System.setProperty("catalina.base", System.getProperty("catalina.home"));
+            return;
+        }
+        if (!homeSet && baseSet) {
+            System.setProperty("catalina.home", System.getProperty("catalina.base"));
+            return;
+        }
+    }
+  
+    
     public void setUseNaming( boolean b ) {
         useNaming=b;
     }
@@ -196,6 +219,7 @@
         // make sure the thread loader is set
         log.info("Running tomcat5");
         Thread.currentThread().setContextClassLoader( 
this.getClass().getClassLoader());
+        setupBaseAndHome();
         if (starting) {
             load();
             start();

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to