geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r390769 [2/2] - in /geronimo/branches/1.1: assemblies/j2ee-jetty-server/ assemblies/j2ee-jetty-server/src/var/config/ assemblies/j2ee-tomcat-server/ assemblies/j2ee-tomcat-server/src/var/config/ modules/client-builder/src/java/org/apache/ge...
Date Sun, 02 Apr 2006 02:01:44 GMT
Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
Sat Apr  1 18:01:40 2006
@@ -160,13 +160,7 @@
     }
 
     public void start(Configuration configuration) throws InvalidConfigException {
-        // load the attribute overrides from the attribute store
-        Collection gbeans = configuration.getGBeans().values();
-        if (attributeStore != null) {
-            gbeans = attributeStore.applyOverrides(configuration.getId(), gbeans, configuration.getConfigurationClassLoader());
-        }
-
-        ConfigurationUtil.startConfigurationGBeans(gbeans, configuration, kernel);
+        ConfigurationUtil.startConfigurationGBeans(configuration.getAbstractName(), configuration,
kernel, attributeStore);
 
         if (configurationList != null) {
             configurationList.addConfiguration(configuration.getId().toString());
@@ -174,6 +168,12 @@
     }
 
     protected void stop(Configuration configuration) throws InvalidConfigException {
+        // stop all of the child configurations first
+        for (Iterator iterator = configuration.getChildren().iterator(); iterator.hasNext();)
{
+            Configuration childConfiguration = (Configuration) iterator.next();
+            stop(childConfiguration);
+        }
+
         try {
             Collection gbeans = configuration.getGBeans().values();
 
@@ -184,6 +184,7 @@
                 kernel.stopGBean(gbeanName);
             }
 
+            // unload the gbeans
             for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
                 GBeanData gbeanData = (GBeanData) iterator.next();
                 AbstractName gbeanName = gbeanData.getAbstractName();

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Sat Apr  1 18:01:40 2006
@@ -285,11 +285,13 @@
             }
         }
 
-//        // add parents to the parents reference collection
-//        configurationData.addDependencies(parentNames);
-//        configurationData.setReferencePatterns("Parents", parentNames);
-//
-//        configurationData.setAttribute("naming", naming);
+        for (Iterator iterator = configurationData.getChildConfigurations().values().iterator();
iterator.hasNext();) {
+            ConfigurationData childConfigurationData = (ConfigurationData) iterator.next();
+            LinkedHashSet childParentIds = resolveParentIds(childConfigurationData);
+            // remove this configuration's id from the parent Ids since it will cause an
infinite loop
+            childParentIds.remove(configurationData.getId());
+            parentIds.addAll(childParentIds);
+        }
         return parentIds;
     }
 

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
Sat Apr  1 18:01:40 2006
@@ -151,7 +151,7 @@
             throw new UnsupportedOperationException();
         }
 
-        public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException
{
+        public URL resolve(Artifact configId, String moduleName, URI uri) throws NoSuchConfigException,
MalformedURLException {
             throw new UnsupportedOperationException();
         }
     }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
Sat Apr  1 18:01:40 2006
@@ -186,7 +186,7 @@
             return null;
         }
 
-        public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException
{
+        public URL resolve(Artifact configId, String moduleName, URI uri) throws NoSuchConfigException,
MalformedURLException {
             return baseURL;
         }
 

Modified: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
(original)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Sat Apr  1 18:01:40 2006
@@ -23,6 +23,8 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.List;
+import java.util.Collections;
 import java.util.jar.JarFile;
 
 import javax.xml.namespace.QName;
@@ -153,10 +155,10 @@
         return environment.getConfigId();
     }
 
-    public ConfigurationData buildConfiguration(Object plan, JarFile unused, Collection configurationStores,
ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
+    public List buildConfiguration(Object plan, JarFile unused, Collection configurationStores,
ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
         ConfigurationType configType = (ConfigurationType) plan;
 
-        return buildConfiguration(configType, configurationStores, targetConfigurationStore);
+        return Collections.singletonList(buildConfiguration(configType, configurationStores,
targetConfigurationStore));
     }
 
     public ConfigurationData buildConfiguration(ConfigurationType configurationType, Collection
configurationStores, ConfigurationStore targetConfigurationStore) throws DeploymentException,
IOException {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Sat Apr  1 18:01:40 2006
@@ -160,14 +160,24 @@
         return location;
     }
 
-    public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException
{
+    public URL resolve(Artifact configId, String moduleName, URI uri) throws NoSuchConfigException,
MalformedURLException {
         File location = repository.getLocation(configId);
         if (location.isDirectory()) {
-            URL locationUrl = location.toURL();
-            URL resolvedUrl = new URL(locationUrl, uri.toString());
-            return resolvedUrl;
+            if (moduleName != null) {
+                location = new File(location, moduleName);
+            }
+            if (location.isDirectory()) {
+                URL locationUrl = location.toURL();
+                URL resolvedUrl = new URL(locationUrl, uri.toString());
+                return resolvedUrl;
+            }
+            URL baseURL = new URL("jar:" + repository.getLocation(configId).toURL().toString()
+ "!/");
+            return new URL(baseURL, uri.toString());
         } else {
             URL baseURL = new URL("jar:" + repository.getLocation(configId).toURL().toString()
+ "!/");
+            if (moduleName != null) {
+                baseURL = new URL(baseURL, moduleName + "/");
+            }
             return new URL(baseURL, uri.toString());
         }
     }

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Sat Apr  1 18:01:40 2006
@@ -21,7 +21,6 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URI;
 import java.net.URL;
 import java.security.Permission;
 import java.security.PermissionCollection;
@@ -297,8 +296,6 @@
             Set securityRoles = collectRoleNames(webApp);
             Map rolePermissions = new HashMap();
 
-            URI baseUri = URI.create(webModule.getTargetPath() + "/");
-            webModuleData.setAttribute("webAppRoot", baseUri);
             webModuleData.setAttribute("contextPath", webModule.getContextRoot());
 
             //Add dependencies on managed connection factories and ejbs in this app
@@ -309,8 +306,6 @@
 
             webModuleData.setAttribute("componentContext", compContext);
             webModuleData.setAttribute("userTransaction", userTransaction);
-            //classpath may have been augmented with enhanced classes
-//            webModuleData.setAttribute("webClassPath", webModule.getWebClasspath());
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
             //N.B. use earContext not moduleContext
@@ -425,7 +420,7 @@
 
             if (!module.isStandAlone()) {
                 ConfigurationData moduleConfigurationData = moduleContext.getConfigurationData();
-                earContext.addChildConfiguration(moduleConfigurationData);
+                earContext.addChildConfiguration(module.getTargetPath(), moduleConfigurationData);
             }
         } catch (DeploymentException de) {
             throw de;

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Sat Apr  1 18:01:40 2006
@@ -410,7 +410,7 @@
             return null;
         }
 
-        public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException
{
+        public URL resolve(Artifact configId, String moduleName, URI uri) throws NoSuchConfigException,
MalformedURLException {
             return baseURL;
         }
 

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
Sat Apr  1 18:01:40 2006
@@ -261,7 +261,7 @@
             }
             return (AbstractName[]) results.toArray(new AbstractName[results.size()]);
         } catch (Exception e) {
-            throw new IllegalArgumentException("Unable to look up connectors for Jetty container
'"+containerName +"': "+e);
+            throw new IllegalArgumentException("Unable to look up connectors for Tomcat container
'"+containerName +"': "+e);
         }
     }
 

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Sat Apr  1 18:01:40 2006
@@ -55,7 +55,7 @@
 /**
  * Wrapper for a WebApplicationContext that sets up its J2EE environment.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 387050 $ $Date$
  */
 public class TomcatWebAppContext implements GBeanLifecycle, TomcatContext, WebModule {
 
@@ -67,8 +67,6 @@
 
     protected Context context = null;
 
-//    private final URI webAppRoot;
-
     private String path = null;
 
     private String docBase = null;
@@ -115,9 +113,6 @@
             ClassLoader classLoader,
             String objectName,
             String originalSpecDD,
-            URI relativeWebAppRoot,
-            URI[] webClassPath,
-            boolean contextPriorityClassLoader,
             URL configurationBaseUrl,
             SecurityHolder securityHolder,
             String virtualServer,
@@ -141,8 +136,6 @@
             throws Exception {
 
         assert classLoader != null;
-        assert relativeWebAppRoot != null;
-//        assert webClassPath != null;
         assert configurationBaseUrl != null;
         assert transactionContextManager != null;
         assert trackedConnectionAssociator != null;
@@ -158,8 +151,7 @@
         } else {
             root = URI.create(configurationBaseUrl.toString());
         }
-        URI webAppRoot = root.resolve(relativeWebAppRoot);
-        this.setDocBase(webAppRoot.getPath());
+        this.setDocBase(root.getPath());
         this.container = container;
         this.originalSpecDD = originalSpecDD;
 
@@ -429,9 +421,6 @@
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addAttribute("deploymentDescriptor", String.class, true);
-        infoBuilder.addAttribute("webAppRoot", URI.class, true);
-        infoBuilder.addAttribute("webClassPath", URI[].class, true);
-        infoBuilder.addAttribute("contextPriorityClassLoader", boolean.class, true);
         infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
 
         infoBuilder.addAttribute("contextPath", String.class, true);
@@ -463,9 +452,6 @@
                 "classLoader",
                 "objectName",
                 "deploymentDescriptor",
-                "webAppRoot",
-                "webClassPath",
-                "contextPriorityClassLoader",
                 "configurationBaseUrl",
                 "securityHolder",
                 "virtualServer",

Modified: geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Sat Apr  1 18:01:40 2006
@@ -45,9 +45,9 @@
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 387050 $ $Date$
  */
-public class AbstractWebModuleTest extends TestCase {
+public abstract class AbstractWebModuleTest extends TestCase {
 
     protected ClassLoader cl;
     protected final static String securityRealmName = "demo-properties-realm";
@@ -64,10 +64,7 @@
         TomcatWebAppContext app = new TomcatWebAppContext(cl,
                 null,
                 null,
-                relativeWebAppRoot,
-                new URI[]{},
-                false,
-                configurationBaseURL,
+                new URL(configurationBaseURL, relativeWebAppRoot.getPath()),
                 securityHolder,
                 null,
                 Collections.EMPTY_MAP,
@@ -143,7 +140,7 @@
         loginConfiguration.doStop();
     }
 
-    protected void setUp(String realmClass) throws Exception {
+    protected void init(String realmClass) throws Exception {
         cl = this.getClass().getClassLoader();
 
         RealmGBean realm = null;
@@ -189,5 +186,6 @@
 
     protected void tearDown() throws Exception {
         connector.doStop();
+        super.tearDown();
     }
 }

Modified: geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
Sat Apr  1 18:01:40 2006
@@ -24,7 +24,7 @@
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 387050 $ $Date$
  */
 public class ApplicationTest extends AbstractWebModuleTest {
 
@@ -45,6 +45,7 @@
     }
 
     protected void setUp() throws Exception {
-        super.setUp(null);
-   }
+        super.setUp();
+        super.init(null);
+    }
 }

Modified: geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
Sat Apr  1 18:01:40 2006
@@ -27,7 +27,7 @@
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 387050 $ $Date$
  */
 public class ContainerTest extends AbstractWebModuleTest {
 
@@ -102,7 +102,8 @@
 
 
     protected void setUp() throws Exception {
-        super.setUp(null);
-   }
+        super.setUp();
+        super.init(null);
+    }
 
 }

Modified: geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
Sat Apr  1 18:01:40 2006
@@ -33,7 +33,7 @@
 /**
  * Tests the JAAS security for Tomcat
  *
- * @version $Revision$ $Date$
+ * @version $Revision: 387050 $ $Date$
  */
 public class JAASSecurityTest extends AbstractWebModuleTest {
 
@@ -174,9 +174,10 @@
     }
 
     protected void setUp() throws Exception {
-        super.setUp("org.apache.geronimo.tomcat.realm.TomcatJAASRealm");
+        super.setUp();
+        super.init("org.apache.geronimo.tomcat.realm.TomcatJAASRealm");
         setUpSecurity();
-   }
+    }
 
     protected void tearDown() throws Exception {
         tearDownSecurity();

Modified: geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
Sat Apr  1 18:01:40 2006
@@ -45,7 +45,7 @@
 /**
  * Tests the JACC security for Tomcat
  *
- * @version $Revision$ $Date$
+ * @version $Revision: 387050 $ $Date$
  */
 public class JACCSecurityTest extends AbstractWebModuleTest {
 
@@ -216,7 +216,8 @@
     }
 
     protected void setUp() throws Exception {
-        super.setUp("org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm");
+        super.setUp();
+        super.init("org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm");
         setUpSecurity();
     }
 

Modified: geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
Sat Apr  1 18:01:40 2006
@@ -26,7 +26,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -104,7 +103,7 @@
     }
 
     public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException
{
-        return createModule(plan, moduleFile, "war", null, true, null, null, naming);
+        return createModule(plan, moduleFile, ".", null, true, null, null, naming);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws
DeploymentException {
@@ -174,16 +173,11 @@
             Artifact configId = new Artifact(earConfigId.getGroupId(), earConfigId.getArtifactId()
+ "_" + module.getTargetPath(), earConfigId.getVersion(), "car");
             environment.setConfigId(configId);
             environment.addDependency(earConfigId, ImportType.ALL);
-            File configurationDir;
-            try {
-                configurationDir = targetConfigurationStore.createNewConfigurationDir(environment.getConfigId());
-            } catch (ConfigurationAlreadyExistsException e) {
-                throw new DeploymentException(e);
-            }
+            File configurationDir = new File(earContext.getBaseDir(), module.getTargetPath());
+            configurationDir.mkdirs();
 
             // construct the web app deployment context... this is the same class used by
the ear context
             try {
-
                 moduleContext = new EARContext(configurationDir,
                         environment,
                         ConfigurationModuleType.WAR,
@@ -193,21 +187,16 @@
                 DeploymentUtil.recursiveDelete(configurationDir);
                 throw e;
             }
-            //TODO this is extremely fishy
-            //Add the ear parent here since it can't be loaded by any config store.
-//            environment.addDependency(earConfigId, ImportType.ALL);
         }
         module.setEarContext(moduleContext);
 
         try {
-            URI baseDir = URI.create(module.getTargetPath() + "/");
-
             // add the warfile's content to the configuration
             JarFile warFile = module.getModuleFile();
             Enumeration entries = warFile.entries();
             while (entries.hasMoreElements()) {
                 ZipEntry entry = (ZipEntry) entries.nextElement();
-                URI targetPath = baseDir.resolve(new URI(null, entry.getName(), null));
+                URI targetPath = new URI(null, entry.getName(), null);
                 if (entry.getName().equals("WEB-INF/web.xml")) {
                     moduleContext.addFile(targetPath, module.getOriginalSpecDD());
                 } else if (entry.getName().startsWith("WEB-INF/lib") && entry.getName().endsWith(".jar"))
{



Mime
View raw message