geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r111175 - in geronimo/trunk/modules: assembly assembly/src/plan tomcat tomcat/src/java/org/apache/geronimo/tomcat
Date Wed, 08 Dec 2004 00:20:38 GMT
Author: jlaskowski
Date: Tue Dec  7 16:20:37 2004
New Revision: 111175

URL: http://svn.apache.org/viewcvs?view=rev&rev=111175
Log:
 o TomcatModuleBuilder can deploy webapps that reference TomcatContainer GBean
 o TomcatContainer invokes a Tomcat instance that handles the deployed webapps

TODO: TomcatClassloader so that appropriate libs are picked up using it
TODO: TomcatRequestHandler - currently TomcatContainer creates a HTTP listener - configuration
not possible
TODO: Webapps URLs are generated in a random way
TODO: It's not yet possible to run two webapps at once


Modified:
   geronimo/trunk/modules/assembly/maven.xml
   geronimo/trunk/modules/assembly/project.xml
   geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml
   geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
   geronimo/trunk/modules/tomcat/maven.xml
   geronimo/trunk/modules/tomcat/project.xml
   geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
   geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java

Modified: geronimo/trunk/modules/assembly/maven.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/maven.xml?view=diff&rev=111175&p1=geronimo/trunk/modules/assembly/maven.xml&r1=111174&p2=geronimo/trunk/modules/assembly/maven.xml&r2=111175
==============================================================================
--- geronimo/trunk/modules/assembly/maven.xml	(original)
+++ geronimo/trunk/modules/assembly/maven.xml	Tue Dec  7 16:20:37 2004
@@ -331,6 +331,9 @@
             <ant:arg value="distribute"/>
             <ant:arg value="${maven.repo.local}/geronimo/wars/geronimo-jmxdebug-${pom.currentVersion}.war"/>
         </ant:java>
+        
+        <ant:copy todir="${distDir}/var/catalina/conf"  file="${project.root}/modules/tomcat/src/var/web.xml"/>
+        
     </goal>
 
     <goal name="cli">

Modified: geronimo/trunk/modules/assembly/project.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/project.xml?view=diff&rev=111175&p1=geronimo/trunk/modules/assembly/project.xml&r1=111174&p2=geronimo/trunk/modules/assembly/project.xml&r2=111175
==============================================================================
--- geronimo/trunk/modules/assembly/project.xml	(original)
+++ geronimo/trunk/modules/assembly/project.xml	Tue Dec  7 16:20:37 2004
@@ -180,16 +180,6 @@
                 <repository>true</repository>
             </properties>
         </dependency>
-<!-- Tomcat module still breaks a clean build
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-tomcat</artifactId>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <repository>true</repository>
-            </properties>
-        </dependency>
--->
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-jetty-builder</artifactId>
@@ -606,6 +596,11 @@
                 <client>true</client>
                 <deploy>true</deploy>
                 <clideployer>true</clideployer>
+<!-- the tomcat module's requirement
+   - uncomment it to run Apache Tomcat as a web container
+   -
+                <repository>true</repository>
+   -->
             </properties>
         </dependency>
 
@@ -703,17 +698,144 @@
                 <repository>true</repository>
             </properties>
         </dependency>
+<!-- the tomcat module's requirement
+   - uncomment it to run Apache Tomcat as a web container
+   -
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-tomcat</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
         <dependency>
             <groupId>tomcat</groupId>
             <artifactId>catalina</artifactId>
-            <!-- Don't want to break the other modules that rely on the libs -->
-            <!--version>&tomcat-version;</version-->
             <version>5.5.4</version>
             <url>http://jakarta.apache.org/tomcat/</url>
             <properties>
                 <repository>true</repository>
             </properties>
         </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina-optional</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-coyote</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-http</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-compiler</artifactId>
+            <version>&tomcat-version;</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-runtime</artifactId>
+            <version>&tomcat-version;</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-util</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-resources</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>servlets-default</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>servlets-invoker</artifactId>
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>&commons-beanutils-version;</version>
+            <url>http://jakarta.apache.org/commons/beanutils</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>commons-digester</groupId>
+            <artifactId>commons-digester</artifactId>
+            <version>&commons-digester-version;</version>
+            <url>http://jakarta.apache.org/commons/digester</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>commons-modeler</groupId>
+            <artifactId>commons-modeler</artifactId>
+            <version>&commons-modeler-version;</version>
+            <url>http://jakarta.apache.org/commons/modeler</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+   -->
 
         <!-- for jsps -->
         <dependency>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml?view=diff&rev=111175&p1=geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml&r1=111174&p2=geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml&r2=111175
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml	Tue Dec  7 16:20:37 2004
@@ -83,9 +83,9 @@
     <dependency>
         <uri>geronimo/jars/geronimo-jetty-${geronimo_version}.jar</uri>
     </dependency>
-    <!--
-       - Uncomment it to run Apache Tomcat
-       -
+<!-- the tomcat module's requirement
+   - uncomment it to run Apache Tomcat as a web container
+   -
     <dependency>
         <uri>geronimo/jars/geronimo-tomcat-${geronimo_version}.jar</uri>
     </dependency>
@@ -98,7 +98,7 @@
     <dependency>
         <uri>tomcat/jars/tomcat-util-5.5.4.jar</uri>
     </dependency>
-    -->
+   -->
     <dependency>
         <uri>geronimo/jars/geronimo-naming-${geronimo_version}.jar</uri>
     </dependency>
@@ -159,11 +159,11 @@
         <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <!-- reference name="SecurityService">geronimo.security:type=SecurityService</reference
-->
     </gbean>
-    <!--
-       - Uncomment it to run Apache Tomcat module builder
-       -
+<!-- the tomcat module's requirement
+   - uncomment it to run Apache Tomcat as a web container
+   -
     <gbean name="geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/J2EEDeployer"
class="org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder"/>
-    -->
+   -->
 
     <gbean name="geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/J2EEDeployer"
class="org.openejb.deployment.OpenEJBModuleBuilder">
         <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml?view=diff&rev=111175&p1=geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml&r1=111174&p2=geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml&r2=111175
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml	Tue Dec  7 16:20:37 2004
@@ -71,9 +71,9 @@
     <dependency>
         <uri>geronimo/jars/geronimo-jetty-${geronimo_version}.jar</uri>
     </dependency>
-    <!--
-       - Uncomment it to run Apache Tomcat as the web container
-       -
+<!-- the tomcat module's requirement
+   - uncomment it to run Apache Tomcat as a web container
+   -
     <dependency>
         <uri>geronimo/jars/geronimo-tomcat-${geronimo_version}.jar</uri>
     </dependency>
@@ -81,10 +81,7 @@
         <uri>tomcat/jars/catalina-5.5.4.jar</uri>
     </dependency>
     <dependency>
-        <uri>tomcat/jars/jasper-compiler-5.5.4.jar</uri>
-    </dependency>
-    <dependency>
-        <uri>tomcat/jars/jasper-runtime-5.5.4.jar</uri>
+        <uri>tomcat/jars/catalina-optional-5.5.4.jar</uri>
     </dependency>
     <dependency>
         <uri>tomcat/jars/tomcat-coyote-5.5.4.jar</uri>
@@ -125,7 +122,7 @@
     <dependency>
         <uri>mx4j/jars/mx4j-2.0.1.jar</uri>
     </dependency>
-    -->
+   -->
     <dependency>
         <uri>geronimo/jars/geronimo-jmxremoting-${geronimo_version}.jar</uri>
     </dependency>
@@ -252,11 +249,11 @@
 
     <!-- default WAR container using Jetty -->
     <gbean name="geronimo.server:type=WebContainer,container=Jetty" class="org.apache.geronimo.jetty.JettyContainerImpl"/>
-    <!--
-       - Uncomment it and comment the above Jetty GBean to run Apache Tomcat as the web container
-       -
+<!-- the tomcat module's requirement
+   - uncomment it to run Apache Tomcat as a web container
+   -
     <gbean name="geronimo.server:type=WebContainer,container=Tomcat" class="org.apache.geronimo.tomcat.TomcatContainer"/>
-    -->
+   -->
     <gbean name="geronimo.server:type=RequestLog,container=Jetty" class="org.apache.geronimo.jetty.requestlog.NCSARequestLog">
         <reference name="JettyContainer">geronimo.server:type=WebContainer,container=Jetty</reference>
         <reference name="ServerInfo">geronimo.system:role=ServerInfo</reference>

Modified: geronimo/trunk/modules/tomcat/maven.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/maven.xml?view=diff&rev=111175&p1=geronimo/trunk/modules/tomcat/maven.xml&r1=111174&p2=geronimo/trunk/modules/tomcat/maven.xml&r2=111175
==============================================================================
--- geronimo/trunk/modules/tomcat/maven.xml	(original)
+++ geronimo/trunk/modules/tomcat/maven.xml	Tue Dec  7 16:20:37 2004
@@ -51,42 +51,5 @@
 		<copy todir="${maven.build.dest}/META-INF/geronimo-service.xml" file="src/plan/tomcat-plan.xml"/>
 	</preGoal>
 
-	<postGoal name="jar:jar">
-	
-        <j:set var="geronimoHome" value="../assembly/target/${pom.groupId}-${pom.currentVersion}"/>
-
-		<!-- 
-		   - TODO: There must be a better way!
-		   - copy the dependencies (specified in tomcat-plan.xml)
-		  -->
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/geronimo/jars"
-		      file="target/${maven.final.name}.jar"/>
-		      <copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/tomcat/jars">
-		      <!-- Don't want to break the other modules that rely on the libs -->
-		      <!-- fileset dir="${maven.repo.local}/tomcat/jars" includes="*-&tomcat-version;.jar"/
-->
-		      <fileset dir="${maven.repo.local}/tomcat/jars" includes="*-5.5.4.jar"/>
-		</copy>
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/commons-beanutils/jars"
-		      file="${maven.repo.local}/commons-beanutils/jars/commons-beanutils-&commons-beanutils-version;.jar"/>
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/commons-collections/jars"
-		      file="${maven.repo.local}/commons-collections/jars/commons-collections-&commons-collections-version;.jar"/>
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/commons-digester/jars"
-		      file="${maven.repo.local}/commons-digester/jars/commons-digester-&commons-digester-version;.jar"/>
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/commons-modeler/jars"
-		      file="${maven.repo.local}/commons-modeler/jars/commons-modeler-&commons-modeler-version;.jar"/>
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/xerces/jars"
-		      file="${maven.repo.local}/xerces/jars/xercesImpl-&xerces-version;.jar"/>
-		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/mx4j/jars"
-		      file="${maven.repo.local}/mx4j/jars/mx4j-&mx4j-version;.jar"/>
-        
-        <copy todir="${geronimoHome}/var/catalina/conf" file="src/var/web.xml"/>
-        
-        <echo>Deploying Apache Tomcat configuration</echo>
-        <java fork="true" jar="../assembly/target/geronimo-${pom.currentVersion}/bin/deployer.jar"
failonerror="true">
-            <jvmarg value="-ea"/>
-            <arg value="distribute"/>
-            <arg value="src/plan/tomcat-plan.xml"/>
-        </java>
-	</postGoal>	
 </project>
 

Modified: geronimo/trunk/modules/tomcat/project.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/project.xml?view=diff&rev=111175&p1=geronimo/trunk/modules/tomcat/project.xml&r1=111174&p2=geronimo/trunk/modules/tomcat/project.xml&r2=111175
==============================================================================
--- geronimo/trunk/modules/tomcat/project.xml	(original)
+++ geronimo/trunk/modules/tomcat/project.xml	Tue Dec  7 16:20:37 2004
@@ -104,6 +104,21 @@
                 <repository>true</repository>
             </properties>
         </dependency>
+        <!-- 
+           - Required until any realm is provided to Tomcat
+           - See StandardEngine::getRealm() 
+           -->
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina-optional</artifactId>
+            <!-- Don't want to break the other modules that rely on the libs -->
+            <!--version>&tomcat-version;</version-->
+            <version>5.5.4</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
         <dependency>
             <groupId>tomcat</groupId>
             <artifactId>tomcat-coyote</artifactId>

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java?view=diff&rev=111175&p1=geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java&r1=111174&p2=geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java&r2=111175
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
Tue Dec  7 16:20:37 2004
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.tomcat;
 
+import mx4j.log.FileLogger;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
 import org.apache.catalina.Host;
@@ -39,11 +41,16 @@
 public class TomcatContainer implements GBeanLifecycle {
 
     private static final Log log = LogFactory.getLog(TomcatContainer.class);
-    
+
     /**
      * The default value of CATALINA_HOME variable
      */
     private static final String CATALINA_HOME = "var/catalina";
+    
+    /**
+     * Work directory
+     */
+    private static final String WORK_DIR = "work"; 
 
     /**
      * Reference to the org.apache.catalina.Embedded embedded.
@@ -105,6 +112,13 @@
             embedded = new Embedded();
         }
 
+        // Assemble FileLogger as a gbean
+        /*
+         * FileLogger fileLog = new FileLogger(); fileLog.setDirectory(".");
+         * fileLog.setPrefix("vsjMbedTC5"); fileLog.setSuffix(".log");
+         * fileLog.setTimestamp(true);
+         */
+
         // 2. Set the relevant properties of this object itself. In particular,
         // you will want to establish the default Logger to be used, as well as
         // the default Realm if you are using container-managed security.
@@ -113,7 +127,7 @@
         // 3. Call createEngine() to create an Engine object, and then call its
         // property setters as desired.
         engine = embedded.createEngine();
-        engine.setName("Geronimo");
+        engine.setName("tomcat.engine");
         engine.setDefaultHost("localhost");
 
         // 4. Call createHost() to create at least one virtual Host associated
@@ -122,7 +136,7 @@
         // Engine with engine.addChild(host).
         host = embedded.createHost("localhost", "");
         // TODO: Make it that gbean's attribute or tomcatwebappcontext's one
-        ((StandardHost) host).setWorkDir(CATALINA_HOME);
+        ((StandardHost) host).setWorkDir(WORK_DIR);
 
         engine.addChild(host);
 
@@ -132,6 +146,7 @@
         // zero-length string, which will be used to process all requests not
         // mapped to some other Context. After you customize this Context, add
         // it to the corresponding Host with host.addChild(context).
+        // TODO: Make a default webapp configurable - another gbean?
         defaultContext = embedded.createContext("", "");
         defaultContext.setParentClassLoader(this.getClass().getClassLoader());
         host.addChild(defaultContext);
@@ -179,8 +194,14 @@
      * @see org.apache.catalina.Host
      */
     public void addContext(Context ctx) {
-        ctx.setParentClassLoader(this.getClass().getClassLoader());
-        host.addChild(ctx);
+        // TODO: Rethink what we're doing here
+        // The param - ctx - extends StandardContext, but at the same time we don't leverage
it.
+        // TomcatContainer creates it again - so in fact there're two classes for the same
thing.
+        // The question comes up what do we get from having the
+        // TomcatWebAppContext class extend Tomcat's StandardContext?
+        Context anotherCtxObj = embedded.createContext(ctx.getPath(), ctx.getDocBase());
+        anotherCtxObj.setParentClassLoader(this.getClass().getClassLoader());
+        host.addChild(anotherCtxObj);
     }
 
     public void removeContext(Context ctx) {

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?view=diff&rev=111175&p1=geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java&r1=111174&p2=geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java&r2=111175
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Tue Dec  7 16:20:37 2004
@@ -23,7 +23,6 @@
 
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.loader.WebappClassLoader;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -60,8 +59,10 @@
 
     public void doStart() throws WaitingException, Exception {
 
+        // See the note of TomcatContainer::addContext
         container.addContext(this);
-        super.start();
+        // Is it necessary - doesn't Tomcat Embedded take care of it?
+        // super.start();
 
         log.info("TomcatWebAppContext started");
     }

Mime
View raw message