geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r538916 - in /geronimo/server/trunk: assemblies/geronimo-boilerplate-minimal/ configs/client-system/ configs/j2ee-system/ configs/jsr88-deploymentfactory/ configs/online-deployer/ modules/geronimo-kernel/ modules/geronimo-kernel/src/main/ja...
Date Thu, 17 May 2007 13:31:29 GMT
Author: kevan
Date: Thu May 17 06:31:27 2007
New Revision: 538916

URL: http://svn.apache.org/viewvc?view=rev&rev=538916
Log:
Fix EJB deployment errors. The ClassLoader used during OpenEJB annotation processing did not
include any application dependencies. So, NoClassDefErrors could occur during deployment.
Seems to be fixed with these changes

Added:
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
      - copied, changed from r537859, geronimo/server/trunk/modules/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/TemporaryClassLoader.java
Removed:
    geronimo/server/trunk/modules/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/TemporaryClassLoader.java
Modified:
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml
    geronimo/server/trunk/configs/client-system/pom.xml
    geronimo/server/trunk/configs/j2ee-system/pom.xml
    geronimo/server/trunk/configs/jsr88-deploymentfactory/pom.xml
    geronimo/server/trunk/configs/online-deployer/pom.xml
    geronimo/server/trunk/modules/geronimo-kernel/pom.xml
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10/pom.xml

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml Thu May 17 06:31:27
2007
@@ -54,6 +54,14 @@
                         <configuration>
                             <artifactItems>
                                 <artifactItem>
+                                    <groupId>asm</groupId>
+                                    <artifactId>asm</artifactId>
+                                </artifactItem>
+                                <artifactItem>
+                                    <groupId>asm</groupId>
+                                    <artifactId>asm-commons</artifactId>
+                                </artifactItem>
+                                <artifactItem>
                                     <groupId>cglib</groupId>
                                     <artifactId>cglib-nodep</artifactId>
                                 </artifactItem>

Modified: geronimo/server/trunk/configs/client-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-system/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/configs/client-system/pom.xml (original)
+++ geronimo/server/trunk/configs/client-system/pom.xml Thu May 17 06:31:27 2007
@@ -119,6 +119,14 @@
                             <version>${version}</version>
                         </element>
                         <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm</artifactId>
+                        </element>
+                        <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm-commons</artifactId>
+                        </element>
+                        <element>
                             <groupId>commons-cli</groupId>
                             <artifactId>commons-cli</artifactId>
                         </element>

Modified: geronimo/server/trunk/configs/j2ee-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-system/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/configs/j2ee-system/pom.xml (original)
+++ geronimo/server/trunk/configs/j2ee-system/pom.xml Thu May 17 06:31:27 2007
@@ -61,6 +61,17 @@
             <version>${version}</version>
         </dependency>
 
+        <!-- Used by TemporaryClassLoader in kernel -->
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-commons</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>commons-cli</groupId>
             <artifactId>commons-cli</artifactId>
@@ -120,6 +131,14 @@
                             <groupId>org.apache.geronimo.modules</groupId>
                             <artifactId>geronimo-transformer</artifactId>
                             <version>${version}</version>
+                        </element>
+                        <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm</artifactId>
+                        </element>
+                        <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm-commons</artifactId>
                         </element>
                         <element>
                             <groupId>commons-cli</groupId>

Modified: geronimo/server/trunk/configs/jsr88-deploymentfactory/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jsr88-deploymentfactory/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/configs/jsr88-deploymentfactory/pom.xml (original)
+++ geronimo/server/trunk/configs/jsr88-deploymentfactory/pom.xml Thu May 17 06:31:27 2007
@@ -99,6 +99,14 @@
                             <version>${version}</version>
                         </element>
                         <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm</artifactId>
+                        </element>
+                        <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm-commons</artifactId>
+                        </element>
+                        <element>
                             <groupId>commons-logging</groupId>
                             <artifactId>commons-logging</artifactId>
                         </element>

Modified: geronimo/server/trunk/configs/online-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/online-deployer/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/configs/online-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/online-deployer/pom.xml Thu May 17 06:31:27 2007
@@ -114,6 +114,14 @@
                             <artifactId>commons-logging</artifactId>
                         </element>
                         <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm</artifactId>
+                        </element>
+                        <element>
+                            <groupId>asm</groupId>
+                            <artifactId>asm-commons</artifactId>
+                        </element>
+                        <element>
                             <groupId>cglib</groupId>
                             <artifactId>cglib-nodep</artifactId>
                         </element>

Modified: geronimo/server/trunk/modules/geronimo-kernel/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/pom.xml Thu May 17 06:31:27 2007
@@ -34,6 +34,16 @@
     
     <dependencies>
         <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-commons</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>cglib</groupId>
             <artifactId>cglib-nodep</artifactId>
         </dependency>

Copied: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
(from r537859, geronimo/server/trunk/modules/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/TemporaryClassLoader.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java?view=diff&rev=538916&p1=geronimo/server/trunk/modules/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/TemporaryClassLoader.java&r1=537859&p2=geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java&r2=538916
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/TemporaryClassLoader.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
Thu May 17 06:31:27 2007
@@ -14,7 +14,7 @@
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
-package org.apache.geronimo.persistence;
+package org.apache.geronimo.kernel.classloader;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -75,7 +75,7 @@
        if (name.startsWith("java.") ||
                name.startsWith("javax.") ||
                name.startsWith("sun.")) {
-           return Class.forName(name, resolve, getClass().getClassLoader());
+           return getParent().loadClass(name);
        }
 
        String resourceName = name.replace('.', '/') + ".class";

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Thu May 17 06:31:27 2007
@@ -20,6 +20,7 @@
 import java.io.IOException;
 import java.net.URI;
 import java.net.URL;
+import java.net.MalformedURLException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -61,6 +62,7 @@
 import org.apache.geronimo.deployment.ClassPathList;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedEjbJar;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.classloader.TemporaryClassLoader;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
@@ -423,7 +425,8 @@
 
     public void initContext(EARContext earContext, Module module, ClassLoader classLoader)
throws DeploymentException {
         EjbModule ejbModule = (EjbModule) module;
-        ejbModule.setClassLoader(classLoader);
+        EarData earData = (EarData) earContext.getGeneralData().get(EarData.class);
+        
         EjbJarInfo ejbJarInfo = getEjbJarInfo(earContext, ejbModule, classLoader);
 
         ejbModule.setEjbJarInfo(ejbJarInfo);
@@ -485,9 +488,14 @@
     private EjbJarInfo getEjbJarInfo(EARContext earContext, EjbModule ejbModule, ClassLoader
classLoader) throws DeploymentException {
         EarData earData = (EarData) earContext.getGeneralData().get(EarData.class);
         if (earData.getEjbJars().isEmpty()) {
+            
+            // temporary classloader is used for processing ejb annotations and byte code
manipulation during ejb load 
+            TemporaryClassLoader temporaryClassLoader = new TemporaryClassLoader(new URL[0],
classLoader);
+            
             // create an openejb app module for the ear containing all ejb modules
-            AppModule appModule = new AppModule(ejbModule.getEjbModule().getClassLoader(),
ejbModule.getEjbModule().getModuleId());
+            AppModule appModule = new AppModule(classLoader, ejbModule.getEjbModule().getModuleId());
             for (EjbModule module : earData.getEjbModuels()) {
+                module.setClassLoader(temporaryClassLoader);
                 appModule.getEjbModules().add(module.getEjbModule());
             }
 

Modified: geronimo/server/trunk/modules/geronimo-persistence-jpa10/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10/pom.xml?view=diff&rev=538916&r1=538915&r2=538916
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10/pom.xml Thu May 17 06:31:27 2007
@@ -35,16 +35,6 @@
 
     <dependencies>
 
-        <dependency>
-            <groupId>asm</groupId>
-            <artifactId>asm</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>asm</groupId>
-            <artifactId>asm-commons</artifactId>
-        </dependency>
-
         <!-- g-transaction, g-system come from this -->
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>



Mime
View raw message