geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1128228 - in /geronimo/server/trunk/plugins: j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/ openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/
Date Fri, 27 May 2011 10:00:26 GMT
Author: genspring
Date: Fri May 27 10:00:26 2011
New Revision: 1128228

URL: http://svn.apache.org/viewvc?rev=1128228&view=rev
Log:
GERONIMO-5984 Deployment failed when java ee application module has reference to another util
lib which is packaged in the EAR as well

1, add ejb classpath to ear bundle classpath.

2, Move manifestcp generation logic above the code that is depending on it.

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=1128228&r1=1128227&r2=1128228&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Fri May 27 10:00:26 2011
@@ -396,6 +396,11 @@ public abstract class AbstractWebModuleB
             // and the url class loader will not pick up a manifest from an unpacked dir
             //GERONIMO-4972 this can't be correct for one-bundle deployments.
             moduleContext.addManifestClassPath(warFile, RELATIVE_MODULE_BASE_URI, manifestcp);
+            
+            for (String classpath : manifestcp) {
+                earContext.addToClassPath(module.resolve(classpath).toString());
+            }
+            
         } catch (IOException e) {
             throw new DeploymentException("Problem deploying war", e);
         } finally {

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1128228&r1=1128227&r2=1128228&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Fri May 27 10:00:26 2011
@@ -49,6 +49,7 @@ import javax.xml.ws.WebServiceContext;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.wrapper.ResourceAdapterWrapperGBean;
+import org.apache.geronimo.deployment.ClassPathUtils;
 import org.apache.geronimo.deployment.Deployable;
 import org.apache.geronimo.deployment.DeployableJarFile;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
@@ -668,6 +669,14 @@ public class EjbModuleBuilder implements
             } else {
                 // extract the ejbJar file into a standalone packed jar file and add the
contents to the output
                 earContext.addIncludeAsPackedJar(URI.create(module.getTargetPath()), moduleFile);
+               // add manifest class path entries to the ejb module classpath
+                Set<String> EjbModuleClasspaths = module.getClassPath();
+                earContext.addManifestClassPath(moduleFile, URI.create("."), EjbModuleClasspaths);
+                
+                for (String classpath:EjbModuleClasspaths){
+                    earContext.addToClassPath(classpath);
+                }
+                
             }
             //earContext.addInclude(".", moduleFile);
         } catch (IOException e) {
@@ -714,9 +723,17 @@ public class EjbModuleBuilder implements
             }
         }
     }
+    
 
     private void doInitContext(EARContext earContext, Module module, Bundle bundle) throws
DeploymentException {
         EjbModule ejbModule = (EjbModule) module;
+        
+        Collection<String> manifestcp = module.getClassPath();
+        manifestcp.add(module.getTargetPath());
+        EARContext moduleContext = module.getEarContext();
+        Collection<String> moduleLocations = EARContext.MODULE_LIST_KEY.get(module.getRootEarContext().getGeneralData());
+        URI baseUri = URI.create(module.getTargetPath());
+        moduleContext.getCompleteManifestClassPath(module.getDeployable(), baseUri, URI.create("."),
manifestcp, moduleLocations);
 
         GeronimoEjbInfo ejbInfo = getEjbInfo(earContext, ejbModule, bundle);
 
@@ -758,12 +775,7 @@ public class EjbModuleBuilder implements
         // Add extra gbean declared in the geronimo-openejb.xml file
         serviceBuilders.build(ejbModule.getVendorDD(), earContext, ejbModule.getEarContext());
 
-        Collection<String> manifestcp = module.getClassPath();
-        manifestcp.add(module.getTargetPath());
-        EARContext moduleContext = module.getEarContext();
-        Collection<String> moduleLocations = EARContext.MODULE_LIST_KEY.get(module.getRootEarContext().getGeneralData());
-        URI baseUri = URI.create(module.getTargetPath());
-        moduleContext.getCompleteManifestClassPath(module.getDeployable(), baseUri, URI.create("."),
manifestcp, moduleLocations);
+       
         GBeanData ejbModuleGBeanData = new GBeanData(ejbModule.getModuleName(), EjbModuleImpl.class);
         try {
             earContext.addGBean(ejbModuleGBeanData);
@@ -946,7 +958,7 @@ public class EjbModuleBuilder implements
         if (offline) {
             AutoConfig autoConfig = new AutoConfig(configurationFactory);
             autoConfig.autoCreateResources(false);
-            autoConfig.autoCreateContainers(false);
+            autoConfig.autoCreateContainers(true);
             chain.add(autoConfig);
         } else {
             chain.add(new AutoConfig(configurationFactory));



Mime
View raw message