Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 11142 invoked from network); 9 Feb 2001 23:11:32 -0000 Received: from nsqw.olliance.com (HELO mail.olliance.com) (63.150.52.11) by h31.sny.collab.net with SMTP; 9 Feb 2001 23:11:32 -0000 Received: from dhcp-100.sfo.lan ([10.1.1.100] helo=olliance.com ident=jason) by mail.olliance.com with esmtp (Exim 3.12 #1 (Debian)) id 14RMhP-0000Rn-00 for ; Fri, 09 Feb 2001 15:11:31 -0800 Message-ID: <3A8479E9.6070604@olliance.com> Date: Fri, 09 Feb 2001 15:14:49 -0800 From: Jason Brittain Organization: Olliance Inc. User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.7) Gecko/20010105 X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: [PATCH] TC4: TomcatBlock on Avalon 3.1a1: Part 1 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi guys. I've just finished a bunch of changes to make Tomcat 4 (Catalina and Jasper) work on top of Avalon 3.1a1. Remy: Thanks for CatalinaBlock -- it served as a good starting point! What I've done is made the necessary modifications to make Tomcat 4 build as a single Avalon .bar (Block ARchive) file that when deployed into Avalon auto-deploys its own files and directories from the bar file to the filesystem where Catalina and Jasper can use them. Some of my goals that are now done: 1) Make Tomcat 4 deployable as a single .bar file. 2) Make Catalina log through Avalon's LogKit package. 3) Make Jasper work so that JSPs also work (this was tough as it turned out). 4) Make Tomcat's build system able to build the .bar file. 5) Only patch Catalina's code where absolutely necessary, and then only make patches that are sure not to disturb stand-alone behavior. In the process, I decided that the name of the block should really be TomcatBlock, not CatalinaBlock, since the block contains Catalina, Jasper, and the demo/test webapps. Let me know if you don't agree. So, I've replaced CatalinaBlock with TomcatBlock, which is based on CatalinaBlock but is heavily modified. In order to make Catalina log through Avalon, I rewrote the AccessLogValve so that we now have FileAccessLogValve and AvalonAccessLogValve which are both subclasses of AccessLogValveBase. I also added org.apache.catalina.logger.AvalonFileLogger so that the other logs can also log through Avalon. I modified the main build.xml file and also Catalina's build.xml file so that from the top-level you can do: ./build.sh dist then ./build.sh dist-opt-avalon in order to build tomcat-4.0.bar. I moved that target out of Catalina's build.xml file because it needs to include more than just Catalina. So now it resides in the top-level build.xml file, and its behavior is quite a bit different. At first, Catalina ran fine this way, but Jasper didn't. I narrowed the problem down to the fact that Jasper needs tools.jar on its classpath, and that it wasn't finding it. In order to fix the problem, I had to make a small patch to the Bootstrap class. I'll go into more detail about that in one of my next mails (including the diff). What changed overall? Files removed: catalina/src/conf/catalina.conf.xml catalina/src/share/org/apache/catalina/valves/AccessLogValve.java catalina/src/share/org/apache/catalina/startup/CatalinaBlock.java catalina/src/share/org/apache/catalina/startup/CatalinaBlock.xinfo Files patched: build.xml catalina/build.xml catalina/src/share/org/apache/catalina/core/ContainerBase.java catalina/src/share/org/apache/catalina/startup/Bootstrap.java Files added: catalina/src/conf/avalon-MANIFEST.MF catalina/src/conf/avalon-server.xml catalina/src/conf/tomcat-4.0.conf.xml catalina/src/share/org/apache/catalina/logger/AvalonFileLogger.java catalina/src/share/org/apache/catalina/startup/TomcatBlock.java catalina/src/share/org/apache/catalina/startup/TomcatBlock.xinfo catalina/src/share/org/apache/catalina/valves/AccessLogValveBase.java catalina/src/share/org/apache/catalina/valves/AvalonAccessLogValve.java catalina/src/share/org/apache/catalina/valves/FileAccessLogValve.java After all of these changes I made, Tomcat 4 still builds and runs stand-alone the same as it did before (as far as I can tell by my somewhat limited testing) and it runs as an Avalon 3.1a1 Block. I know this is a bunch of new code, but I think I've tested and documented it enough to make it clear and easy commit. My next mails will include the diffs and the new source. -- Jason Brittain Software Engineer, Olliance Inc. http://www.Olliance.com Current Maintainer, Locomotive Project http://www.Locomotive.org