You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2010/01/14 07:54:27 UTC

svn commit: r899081 - in /geronimo/server/trunk/plugins: jasper/ jasper/geronimo-jasper/ jasper/jasper/src/main/history/ tomcat/ tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ tomcat/tomcat7/ tomcat/tomcat7/src/main/history/

Author: xuhaihong
Date: Thu Jan 14 06:54:27 2010
New Revision: 899081

URL: http://svn.apache.org/viewvc?rev=899081&view=rev
Log:
1. Update Tomcat/Jasper dependency 
2. Set ThreadContextClassLoader to load classes while Tomcat creates MBean

Modified:
    geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml
    geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/jasper/pom.xml
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
    geronimo/server/trunk/plugins/tomcat/pom.xml
    geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml
    geronimo/server/trunk/plugins/tomcat/tomcat7/src/main/history/dependencies.xml

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml Thu Jan 14 06:54:27 2010
@@ -38,7 +38,12 @@
             <groupId>${tomcatGroupId}</groupId>
             <artifactId>jasper</artifactId>
         </dependency>
-
+        
+        <dependency>
+            <groupId>${tomcatGroupId}</groupId>
+            <artifactId>util</artifactId>
+        </dependency>
+        
         <!--<dependency>-->
         <!--<groupId>${tomcatGroupId}</groupId>-->
         <!--<artifactId>jasper-jdt</artifactId>-->

Modified: geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml Thu Jan 14 06:54:27 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<plugin-artifact xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
     <module-id>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>jasper</artifactId>
@@ -42,6 +42,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.ext.tomcat</groupId>
+        <artifactId>util</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>server-security-config</artifactId>
         <type>car</type>
@@ -53,21 +58,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>geronimo-el_1.0_spec</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-el_2.2_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>geronimo-jsp_2.1-MR2_spec</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-jsp_2.2_spec</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/server/trunk/plugins/jasper/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/pom.xml?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/pom.xml (original)
+++ geronimo/server/trunk/plugins/jasper/pom.xml Thu Jan 14 06:54:27 2010
@@ -100,6 +100,18 @@
                     </exclusion>
                 </exclusions>
             </dependency>
+            
+            <dependency>
+                <groupId>${tomcatGroupId}</groupId>
+                <artifactId>util</artifactId>
+                <version>${tomcatVersion}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>${tomcatGroupId}</groupId>
+                        <artifactId>juli</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
 
             <!--<dependency>-->
             <!--<groupId>${tomcatGroupId}</groupId>-->

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java Thu Jan 14 06:54:27 2010
@@ -102,7 +102,7 @@
         if (mbeanServerReference != null) {
             Registry.getRegistry(null, null).setMBeanServer(mbeanServerReference.getMBeanServer());
         }
-        
+
         if (catalinaHome == null){
             catalinaHome = DEFAULT_CATALINA_HOME;
         }
@@ -128,7 +128,7 @@
         Reader in = new StringReader(serverConfig);
 
         try {
-            ServerType serverType = loadServerType(in);            
+            ServerType serverType = loadServerType(in);
             server = serverType.build(classLoader, kernel);
         } finally {
             in.close();
@@ -144,8 +144,14 @@
     }
 
     public void doStart() throws Exception {
-        server.initialize();
-        ((Lifecycle)server).start();
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(classLoader);
+            server.initialize();
+            ((Lifecycle) server).start();
+        } finally {
+            Thread.currentThread().setContextClassLoader(cl);
+        }
     }
 
     public void doStop() throws Exception {
@@ -174,7 +180,7 @@
         }
         return service;
     }
-    
+
 
     public TomcatServerConfigManager getTomcatServerConfigManager() {
         return tomcatServerConfigManager;

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java Thu Jan 14 06:54:27 2010
@@ -88,7 +88,7 @@
     private static final Logger log = LoggerFactory.getLogger(TomcatWebAppContext.class);
     public static final String GBEAN_REF_CLUSTERED_VALVE_RETRIEVER = "ClusteredValveRetriever";
     public static final String GBEAN_REF_MANAGER_RETRIEVER = "ManagerRetriever";
- 
+
     protected final TomcatContainer container;
     private final ClassLoader classLoader;
     private final Bundle bundle;
@@ -541,21 +541,25 @@
     }
 
     public void doStart() throws Exception {
-
-        // See the note of TomcatContainer::addContext
-        container.addContext(this);
-        // Is it necessary - doesn't Tomcat Embedded take care of it?
-        // super.start();
-        //register the classloader <> dir context association so that tomcat's jndi based getResources works.
-        DirContext resources = context.getResources();
-        if (resources == null) {
-            throw new IllegalStateException("JNDI environment was not set up correctly due to previous error");
-        }
-        DirContextURLStreamHandler.bind(classLoader, resources);
-        if (context instanceof StandardContext)
-            statsProvider = new ModuleStats((StandardContext) context);
-
-        log.debug("TomcatWebAppContext started for " + contextPath);
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(classLoader);
+            // See the note of TomcatContainer::addContext
+            container.addContext(this);
+            // Is it necessary - doesn't Tomcat Embedded take care of it?
+            // super.start();
+            //register the classloader <> dir context association so that tomcat's jndi based getResources works.
+            DirContext resources = context.getResources();
+            if (resources == null) {
+                throw new IllegalStateException("JNDI environment was not set up correctly due to previous error");
+            }
+            DirContextURLStreamHandler.bind(classLoader, resources);
+            if (context instanceof StandardContext)
+                statsProvider = new ModuleStats((StandardContext) context);
+            log.debug("TomcatWebAppContext started for " + contextPath);
+        } finally {
+            Thread.currentThread().setContextClassLoader(cl);
+        }
     }
 
     public void doStop() throws Exception {

Modified: geronimo/server/trunk/plugins/tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/pom.xml?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/tomcat/pom.xml Thu Jan 14 06:54:27 2010
@@ -149,6 +149,7 @@
                     </exclusion>
                 </exclusions>
             </dependency>
+
             <dependency>
                 <groupId>${tomcatGroupId}</groupId>
                 <artifactId>catalina-ha</artifactId>
@@ -187,6 +188,18 @@
                     </exclusion>
                  </exclusions>
             </dependency>
+
+            <dependency>
+                <groupId>${tomcatGroupId}</groupId>
+                <artifactId>util</artifactId>
+                <version>${tomcatVersion}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>${tomcatGroupId}</groupId>
+                        <artifactId>juli</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>   
         </dependencies>
     </dependencyManagement>
 

Modified: geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml (original)
+++ geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml Thu Jan 14 06:54:27 2010
@@ -93,6 +93,11 @@
             <groupId>${tomcatGroupId}</groupId>
             <artifactId>tribes</artifactId>
         </dependency>
+        
+        <dependency>
+            <groupId>${tomcatGroupId}</groupId>
+            <artifactId>util</artifactId>
+        </dependency>
 
         <!-- Check whether we really need this dependency-->  
         <dependency>

Modified: geronimo/server/trunk/plugins/tomcat/tomcat7/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/tomcat7/src/main/history/dependencies.xml?rev=899081&r1=899080&r2=899081&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/tomcat7/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/tomcat/tomcat7/src/main/history/dependencies.xml Thu Jan 14 06:54:27 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<plugin-artifact xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
     <module-id>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>tomcat7</artifactId>
@@ -68,7 +68,7 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>geronimo-annotation_1.0_spec</artifactId>
+        <artifactId>geronimo-annotation_1.1_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>