geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r122575 - in geronimo/trunk/modules: assembly/src/plan tomcat tomcat/src/java/org/apache/geronimo/tomcat tomcat/src/plan tomcat/src/test/org/apache/geronimo/tomcat
Date Thu, 16 Dec 2004 19:55:54 GMT
Author: jlaskowski
Date: Thu Dec 16 11:55:53 2004
New Revision: 122575

URL: http://svn.apache.org/viewcvs?view=rev&rev=122575
Log:
It's no longer mandatory to specify java.endorsed.dirs on the command line while starting
org/apache/geronimo/Tomcat configuration or its webapps.

The variable is set to point to 'lib' directory of Geronimo build. However, the lib contains
Xerces 2.6.0 jars (xercesImpl-2.6.0.jar and xmlParserAPIs-2.2.1.jar), which doesn't seem to
work well. Either the libs will be removed or Xerces will be upgraded to 2.6.2 (these jars
work fine). Currently, the only way to run the tomcat configuration is to remove Xerces jars
from lib directory - it seems Geronimo doesn't need them.

NOTE: If you want to run Tomcat or any webapp delete Xerces 2.6.0 libs from lib directory
of Geronimo build.


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

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-server-tomcat-plan.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-server-tomcat-plan.xml?view=diff&rev=122575&p1=geronimo/trunk/modules/assembly/src/plan/j2ee-server-tomcat-plan.xml&r1=122574&p2=geronimo/trunk/modules/assembly/src/plan/j2ee-server-tomcat-plan.xml&r2=122575
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-server-tomcat-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-server-tomcat-plan.xml	Thu Dec 16 11:55:53
2004
@@ -94,6 +94,8 @@
     <gbean name="geronimo.server:type=WebContainer,container=Tomcat" class="org.apache.geronimo.tomcat.TomcatContainer">
         <attribute name="catalinaHome">var/catalina</attribute>
         <attribute name="port">8090</attribute>
+        <attribute name="endorsedDirs">lib</attribute>
+        <reference name="ServerInfo">geronimo.system:role=ServerInfo</reference>
     </gbean>
 
 </configuration>

Modified: geronimo/trunk/modules/tomcat/maven.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/maven.xml?view=diff&rev=122575&p1=geronimo/trunk/modules/tomcat/maven.xml&r1=122574&p2=geronimo/trunk/modules/tomcat/maven.xml&r2=122575
==============================================================================
--- geronimo/trunk/modules/tomcat/maven.xml	(original)
+++ geronimo/trunk/modules/tomcat/maven.xml	Thu Dec 16 11:55:53 2004
@@ -54,7 +54,10 @@
 -->
 
     <preGoal name="test:test">
-        <mkdir dir="${maven.build.dir}/endorsed"/>
+    
+        <j:set var="endorsed.dir" value="${maven.build.dir}/endorsed"/>
+        
+        <mkdir dir="${endorsed.dir}"/>
         <mkdir dir="${maven.build.dir}/var"/>
         <mkdir dir="${maven.build.dir}/var/catalina"/>
         <mkdir dir="${maven.build.dir}/var/catalina/webapps"/>
@@ -69,7 +72,7 @@
 
         <j:forEach var="dep" items="${pom.dependencies}">
             <j:if test="${dep.artifactId.equals('xercesImpl') || dep.artifactId.equals('xml-apis')}">
-                <copy file="${maven.repo.local}/${dep.groupId}/jars/${dep.artifact}" todir="${maven.build.dir}/endorsed"/>
+                <copy file="${maven.repo.local}/${dep.groupId}/jars/${dep.artifact}" todir="${endorsed.dir}"/>
             </j:if>
         </j:forEach>
     </preGoal>

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=122575&p1=geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java&r1=122574&p2=geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java&r2=122575
==============================================================================
--- 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
Thu Dec 16 11:55:53 2004
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.tomcat;
 
+import java.io.File;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
 import org.apache.catalina.Host;
@@ -27,6 +29,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
 
 /**
  * Apache Tomcat GBean
@@ -93,6 +96,16 @@
      */
     private int port;
 
+    /**
+     * The java.endorsed.dirs directories
+     */
+    private String endorsedDirs = System.getProperty("java.endorsed.dirs");
+
+    /**
+     * Used only to resolve the path to the endorsed standards dir
+     */
+    private ServerInfo serverInfo;
+
     // Required as it's referenced by deployed webapps
     public TomcatContainer() {
         setCatalinaHome(DEFAULT_CATALINA_HOME);
@@ -103,9 +116,10 @@
      * GBean constructor (invoked dynamically when the gbean is declared in a
      * plan)
      */
-    public TomcatContainer(String catalinaHome, int port) {
+    public TomcatContainer(String catalinaHome, int port, ServerInfo serverInfo) {
         setCatalinaHome(catalinaHome);
         setPort(port);
+        this.serverInfo = serverInfo;
     }
 
     public void doFail() {
@@ -124,6 +138,10 @@
     public void doStart() throws Exception {
         log.debug("doStart()");
 
+        // set endorsed dirs (so it's not mandatory to set it up by a user
+        // anymore)
+        System.setProperty("java.endorsed.dirs", serverInfo.resolvePath(getEndorsedDirs()));
+
         // The comments are from the javadoc of the Embedded class
 
         // 1. Instantiate a new instance of this class.
@@ -252,15 +270,26 @@
         this.port = port;
     }
 
+    public String getEndorsedDirs() {
+        return endorsedDirs;
+    }
+
+    public void setEndorsedDirs(String endorsedDirs) {
+        this.endorsedDirs = endorsedDirs;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Tomcat Web Container", TomcatContainer.class);
 
-        infoFactory.setConstructor(new String[] { "catalinaHome", "port" });
+        infoFactory.setConstructor(new String[] { "catalinaHome", "port", "ServerInfo" });
 
         infoFactory.addAttribute("catalinaHome", String.class, true);
         infoFactory.addAttribute("port", int.class, true);
+        infoFactory.addAttribute("endorsedDirs", String.class, true);
+
+        infoFactory.addReference("ServerInfo", ServerInfo.class);
 
         infoFactory.addOperation("addContext", new Class[] { TomcatContext.class });
         infoFactory.addOperation("removeContext", new Class[] { TomcatContext.class });

Modified: geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml?view=diff&rev=122575&p1=geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml&r1=122574&p2=geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml&r2=122575
==============================================================================
--- geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml	(original)
+++ geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml	Thu Dec 16 11:55:53 2004
@@ -92,6 +92,8 @@
     <gbean name="geronimo.server:type=WebContainer,container=Tomcat" class="org.apache.geronimo.tomcat.TomcatContainer">
         <attribute name="catalinaHome">var/catalina</attribute>
         <attribute name="port">8090</attribute>
+        <attribute name="endorsedDirs">lib</attribute>
+        <reference name="ServerInfo">geronimo.system:role=ServerInfo</reference>
     </gbean>
 
 </configuration>

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?view=diff&rev=122575&p1=geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java&r1=122574&p2=geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java&r2=122575
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Thu Dec 16 11:55:53 2004
@@ -169,10 +169,6 @@
         loginServiceGBean.setAttribute("algorithm", "HmacSHA1");
         loginServiceGBean.setAttribute("password", "secret");
 
-        serverInfoName = new ObjectName("geronimo.system:role=ServerInfo");
-        serverInfoGBean = new GBeanData(serverInfoName, ServerInfo.GBEAN_INFO);
-        serverInfoGBean.setAttribute("baseDirectory", ".");
-
         propertiesLMName = new ObjectName("geronimo.security:type=LoginModule,name=demo-properties-login");
         propertiesLMGBean = new GBeanData(propertiesLMName, LoginModuleGBean.GBEAN_INFO);
         propertiesLMGBean.setAttribute("loginModuleClass",
@@ -198,7 +194,6 @@
 
         start(securityServiceGBean);
         start(loginServiceGBean);
-        start(serverInfoGBean);
         start(propertiesLMGBean);
         start(propertiesRealmGBean);
 
@@ -241,10 +236,18 @@
         kernel = new Kernel("test.kernel");
         kernel.boot();
 
+        serverInfoName = new ObjectName("geronimo.system:role=ServerInfo");
+        serverInfoGBean = new GBeanData(serverInfoName, ServerInfo.GBEAN_INFO);
+        serverInfoGBean.setAttribute("baseDirectory", ".");
+
+        start(serverInfoGBean);
+
         // Need to override the constructor for unit tests
         container = new GBeanData(containerName, TomcatContainer.GBEAN_INFO);
         container.setAttribute("catalinaHome", "target/var/catalina");
         container.setAttribute("port", new Integer(8080));
+        container.setAttribute("endorsedDirs", "target/endorsed");
+        container.setReferencePattern("ServerInfo", serverInfoName);
 
         start(container);
 

Mime
View raw message