geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: rev 46225 - in geronimo/trunk: etc modules/tomcat modules/tomcat/src/java/org/apache/geronimo/tomcat modules/tomcat/src/plan modules/tomcat/src/var
Date Fri, 17 Sep 2004 01:03:00 GMT
Author: jlaskowski
Date: Thu Sep 16 18:02:59 2004
New Revision: 46225

Added:
   geronimo/trunk/modules/tomcat/maven.xml
   geronimo/trunk/modules/tomcat/src/plan/
   geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml
   geronimo/trunk/modules/tomcat/src/var/
   geronimo/trunk/modules/tomcat/src/var/server.xml   (contents, props changed)
Modified:
   geronimo/trunk/etc/version-info.ent
   geronimo/trunk/modules/tomcat/project.xml
   geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatGBean.java
Log:
Catalina starts up, but can't yet find its configuration file - server.xml

Modified: geronimo/trunk/etc/version-info.ent
==============================================================================
--- geronimo/trunk/etc/version-info.ent	(original)
+++ geronimo/trunk/etc/version-info.ent	Thu Sep 16 18:02:59 2004
@@ -26,6 +26,7 @@
 <!ENTITY commons-jxpath-version "1.1">
 <!ENTITY commons-logging-version "1.0.3">
 <!ENTITY commons-primitives-version "1.0">
+<!ENTITY commons-digester-version "1.6">
 <!ENTITY concurrent-version "1.3.4">
 <!ENTITY dom4j-version "1.4">
 <!ENTITY ews-version "SNAPSHOT">

Added: geronimo/trunk/modules/tomcat/maven.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/tomcat/maven.xml	Thu Sep 16 18:02:59 2004
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright 2004 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev: 46019 $ $Date: 2004-09-14 11:56:06 +0200 (Tue, 14 Sep 2004) $ -->
+
+<project default="default"
+    xmlns:j="jelly:core"
+    xmlns:define="jelly:define"
+    xmlns:velocity="jelly:velocity">
+
+    <!-- ==================== -->
+    <!-- Default Global Goals -->
+    <!-- ==================== -->
+
+    <goal name="default">
+        <attainGoal name="build"/>
+    </goal>
+
+    <goal name="build">
+        <attainGoal name="jar:install"/>
+    </goal>
+
+    <goal name="rebuild">
+        <attainGoal name="clean"/>
+        <attainGoal name="build"/>
+    </goal>
+
+	<preGoal name="jar:jar">
+		<mkdir dir="${maven.build.dest}/META-INF"/>
+		<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)
+		   - note the version is explicity referenced
+		  -->
+		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/tomcat/jars"
+		      file="${maven.repo.local}/tomcat/jars/catalina-5.0.16.jar"/>
+		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/tomcat/jars"
+		      file="${maven.repo.local}/tomcat/jars/tomcat-util-5.0.16.jar"/>
+		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/commons-digester/jars"
+		      file="${maven.repo.local}/commons-digester/jars/commons-digester-1.6.jar"/>
+		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/commons-collections/jars"
+		      file="${maven.repo.local}/commons-collections/jars/commons-collections-2.1.jar"/>
+
+        <!-- Pre-load the server's repository (copied from assembly's maven.xml) -->
+        <!--
+        <j:set var="repoDir" value="../assembly/target/${pom.groupId}-${pom.currentVersion}/repository"/>
+        <ant:mkdir dir="${repoDir}"/>
+        <ant:copy todir="${repoDir}">
+            <ant:fileset dir="${maven.repo.local}">
+                <j:forEach var="artifact" items="${pom.artifacts}">
+                    <j:set var="dependency" value="${artifact.dependency}"/>
+                    <j:if test="${dependency.getProperty('repository') == 'true'}">
+                        <ant:include name="${dependency.getArtifactDirectory()}/${dependency.getType()}s/${dependency.getArtifact()}"/>
+                    </j:if>
+                </j:forEach>
+            </ant:fileset>
+        </ant:copy>
+        -->
+        
+        <copy todir="${geronimoHome}/var/catalina" file="src/var/server.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="--install"/>
+            <arg value="--plan"/>
+            <arg value="src/plan/tomcat-plan.xml"/>
+            <arg value="--module"/>
+            <arg value="target/${maven.final.name}.jar"/>
+        </java>
+	</postGoal>	
+	
+<!--
+	<postGoal name="jar:jar">
+		<copy todir="../assembly/target/geronimo-${pom.currentVersion}/repository/geronimo/jars"
+		      file="target/${maven.final.name}.jar"/>
+	</postGoal>
+	
+    <goal name="deploy">
+        <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="- -install"/>
+            <arg value="- -plan"/>
+            <arg value="src/plan/tomcat-plan.xml"/>
+        </java>
+    </goal>
+-->
+</project>
+

Modified: geronimo/trunk/modules/tomcat/project.xml
==============================================================================
--- geronimo/trunk/modules/tomcat/project.xml	(original)
+++ geronimo/trunk/modules/tomcat/project.xml	Thu Sep 16 18:02:59 2004
@@ -54,9 +54,54 @@
         </dependency>
         <dependency>
             <groupId>tomcat</groupId>
+            <artifactId>bootstrap</artifactId>
+            <version>&tomcat-version;</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>tomcat</groupId>
             <artifactId>catalina</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>&tomcat-version;</version>
+            <url>http://jakarta.apache.org/tomcat/</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-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>&commons-logging-version;</version>
+            <url>http://jakarta.apache.org/commons/logging</url>
+        </dependency>
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <version>&commons-collections-version;</version>
+            <url>http://jakarta.apache.org/commons/collections</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
         </dependency>
     </dependencies>
 
@@ -66,14 +111,5 @@
                 <include>**/*Test.java</include>
             </includes>                
         </unitTest>
-        <resources>
-            <resource>
-                <directory>${basedir}/src/java</directory>
-                <includes>
-                    <include>**/*.xml</include>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-        </resources>
     </build>
 </project>

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatGBean.java
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatGBean.java	(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatGBean.java	Thu
Sep 16 18:02:59 2004
@@ -18,6 +18,8 @@
 
 import org.apache.catalina.startup.Catalina;
 import org.apache.catalina.util.ServerInfo;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoFactory;
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -33,8 +35,10 @@
  */
 public class TomcatGBean implements GBeanLifecycle {
 
+    private static final Log log = LogFactory.getLog(TomcatGBean.class);
+
     /**
-     * Reference to the org.apache.catalina.startup.Catalina shell. Right now
+     * Reference to the org.apache.catalina.startup.Bootstrap shell. Right now
      * we're just wrapping up the shell, but we'll be replacing it with our own
      * GBean shell for ease of management.
      */
@@ -68,19 +72,27 @@
     }
 
     public void doFail() {
-        doStop();
+        try {
+            doStop();
+        } catch (Exception ignored) {
+        }
     }
 
-    public void doStart() {
-        System.setProperty("catalina.home", catalinaHome);
-        System.setProperty("catalina.base", catalinaBase);
+    public void doStart() throws Exception {
+        log.debug("catalinaHome: " + catalinaHome + ", catalinaBase: " + catalinaBase);
         if (shell == null) {
             shell = new Catalina();
         }
+        if (catalinaHome != null) {
+            shell.setCatalinaHome("catalina.home");
+        }
+        if (catalinaBase != null) {
+            shell.setCatalinaBase("catalina.base");
+        }
         shell.start();
     }
 
-    public void doStop() {
+    public void doStop() throws Exception {
         if (shell != null) {
             shell.stop();
             shell = null;

Added: geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml	Thu Sep 16 18:02:59 2004
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration
+    xmlns="http://geronimo.apache.org/xml/ns/deployment"
+    parentId="org/apache/geronimo/System"
+    configId="org/apache/geronimo/Tomcat"
+    >
+
+    <dependency>
+        <uri>geronimo/jars/geronimo-tomcat-1.0-SNAPSHOT.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>tomcat/jars/catalina-5.0.16.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>tomcat/jars/tomcat-util-5.0.16.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>commons-digester/jars/commons-digester-1.6.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>commons-collections/jars/commons-collections-2.1.jar</uri>
+    </dependency>
+
+    <gbean name="geronimo.tomcat:name=Apache Tomcat" class="org.apache.geronimo.tomcat.TomcatGBean">
+    	<attribute name="CatalinaHome" type="java.lang.String">.</attribute>
+    	<attribute name="CatalinaHome" type="java.lang.String">.</attribute>
+    </gbean>
+
+</configuration>

Added: geronimo/trunk/modules/tomcat/src/var/server.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/tomcat/src/var/server.xml	Thu Sep 16 18:02:59 2004
@@ -0,0 +1,8 @@
+<Server port="8005" shutdown="SHUTDOWN" debug="0">
+	<Service name="Catalina">
+		<Connector port="8080"
+		           maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
+		           enableLookups="false" acceptCount="100"
+		           debug="0" connectionTimeout="20000"/>
+	</Service>
+</Server>
\ No newline at end of file

Mime
View raw message