You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by da...@apache.org on 2006/04/02 04:01:44 UTC

svn commit: r390769 [1/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...

Author: dain
Date: Sat Apr  1 18:01:40 2006
New Revision: 390769

URL: http://svn.apache.org/viewcvs?rev=390769&view=rev
Log:
Child configurations are now included in the main configuration.  This means that ear's will again contain their war files nested as before.
Added the concept of "additional configurations" to the deployment context, which contain additional configurations creted during the deployment process.  These additional configurations are installed as separate entries in the repo.  J2EE app clients are currently the only user of this feature.

Modified:
    geronimo/branches/1.1/assemblies/j2ee-jetty-server/project.xml
    geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml
    geronimo/branches/1.1/assemblies/j2ee-tomcat-server/project.xml
    geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
    geronimo/branches/1.1/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationResolver.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
    geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
    geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
    geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
    geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
    geronimo/branches/1.1/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
    geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/branches/1.1/assemblies/j2ee-jetty-server/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/assemblies/j2ee-jetty-server/project.xml?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/assemblies/j2ee-jetty-server/project.xml (original)
+++ geronimo/branches/1.1/assemblies/j2ee-jetty-server/project.xml Sat Apr  1 18:01:40 2006
@@ -266,24 +266,6 @@
         </dependency>
         <dependency>
             <groupId>geronimo</groupId>
-            <artifactId>webconsole-jetty_geronimo-console-framework-${pom.currentVersion}.war</artifactId>
-            <type>car</type>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <geronimo.assemble>install</geronimo.assemble>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>webconsole-jetty_geronimo-console-standard-${pom.currentVersion}.war</artifactId>
-            <type>car</type>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <geronimo.assemble>install</geronimo.assemble>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>geronimo</groupId>
             <artifactId>jmxdebug-jetty</artifactId>
             <type>car</type>
             <version>${pom.currentVersion}</version>
@@ -312,15 +294,6 @@
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>daytrader-derby-jetty</artifactId>
-            <type>car</type>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <geronimo.assemble>install</geronimo.assemble>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>daytrader-derby-jetty_daytrader-web-${pom.currentVersion}.war</artifactId>
             <type>car</type>
             <version>${pom.currentVersion}</version>
             <properties>

Modified: geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml (original)
+++ geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml Sat Apr  1 18:01:40 2006
@@ -95,12 +95,9 @@
     <configuration name="geronimo/servlets-examples-jetty/${pom.currentVersion}/car"/>
     <configuration name="geronimo/jsp-examples-jetty/${pom.currentVersion}/car"/>
     <configuration name="geronimo/webconsole-jetty/${pom.currentVersion}/car"/>
-    <configuration name="geronimo/webconsole-jetty_geronimo-console-framework-${pom.currentVersion}.war/${pom.currentVersion}/car"/>
-    <configuration name="geronimo/webconsole-jetty_geronimo-console-standard-${pom.currentVersion}.war/${pom.currentVersion}/car"/>
     <configuration name="geronimo/uddi-jetty/${pom.currentVersion}/car"/>
     <configuration name="geronimo/jmxdebug-jetty/${pom.currentVersion}/car"/>
     <configuration name="geronimo/daytrader-derby-jetty/${pom.currentVersion}/car"/>
-    <configuration name="geronimo/daytrader-derby-jetty_daytrader-web-${pom.currentVersion}.war/${pom.currentVersion}/car"/>
     <configuration name="geronimo/remote-deploy-jetty/${pom.currentVersion}/car"/>
     <configuration name="geronimo/hot-deployer/${pom.currentVersion}/car" />
 </attributes>

Modified: geronimo/branches/1.1/assemblies/j2ee-tomcat-server/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/assemblies/j2ee-tomcat-server/project.xml?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/assemblies/j2ee-tomcat-server/project.xml (original)
+++ geronimo/branches/1.1/assemblies/j2ee-tomcat-server/project.xml Sat Apr  1 18:01:40 2006
@@ -266,24 +266,6 @@
         </dependency>
         <dependency>
             <groupId>geronimo</groupId>
-            <artifactId>webconsole-tomcat_geronimo-console-framework-${pom.currentVersion}.war</artifactId>
-            <type>car</type>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <geronimo.assemble>install</geronimo.assemble>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>webconsole-tomcat_geronimo-console-standard-${pom.currentVersion}.war</artifactId>
-            <type>car</type>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <geronimo.assemble>install</geronimo.assemble>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>geronimo</groupId>
             <artifactId>jmxdebug-tomcat</artifactId>
             <type>car</type>
             <version>${pom.currentVersion}</version>
@@ -312,15 +294,6 @@
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>daytrader-derby-tomcat</artifactId>
-            <type>car</type>
-            <version>${pom.currentVersion}</version>
-            <properties>
-                <geronimo.assemble>install</geronimo.assemble>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>daytrader-derby-tomcat_daytrader-web-${pom.currentVersion}.war</artifactId>
             <type>car</type>
             <version>${pom.currentVersion}</version>
             <properties>

Modified: geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml (original)
+++ geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml Sat Apr  1 18:01:40 2006
@@ -101,12 +101,9 @@
     <configuration name="geronimo/servlets-examples-tomcat/${pom.currentVersion}/car"/>
     <configuration name="geronimo/jsp-examples-tomcat/${pom.currentVersion}/car"/>
     <configuration name="geronimo/webconsole-tomcat/${pom.currentVersion}/car"/>
-    <configuration name="geronimo/webconsole-tomcat_geronimo-console-framework-${pom.currentVersion}.war/${pom.currentVersion}/car"/>
-    <configuration name="geronimo/webconsole-tomcat_geronimo-console-standard-${pom.currentVersion}.war/${pom.currentVersion}/car"/>
     <configuration name="geronimo/uddi-tomcat/${pom.currentVersion}/car"/>
     <configuration name="geronimo/jmxdebug-tomcat/${pom.currentVersion}/car"/>
     <configuration name="geronimo/daytrader-derby-tomcat/${pom.currentVersion}/car"/>
-    <configuration name="geronimo/daytrader-derby-tomcat_daytrader-web-${pom.currentVersion}.war/${pom.currentVersion}/car"/>
     <configuration name="geronimo/remote-deploy-tomcat/${pom.currentVersion}/car"/>
     <configuration name="geronimo/hot-deployer/${pom.currentVersion}/car" />
 </attributes>

Modified: geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Sat Apr  1 18:01:40 2006
@@ -45,7 +45,6 @@
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
-import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -350,7 +349,7 @@
         }
 
         EARContext appClientDeploymentContext = appClientModule.getEarContext();
-        ConfigurationData appClientConfigurationData = null;
+//        ConfigurationData appClientConfigurationData = null;
         try {
             try {
 
@@ -485,7 +484,7 @@
                 appClientDeploymentContext.addGBean(appClientContainerGBeanData);
 
                 // get the configuration data
-                appClientConfigurationData = appClientDeploymentContext.getConfigurationData();
+                earContext.addAdditionalDeployment(appClientDeploymentContext.getConfigurationData());
             } finally {
                 if (appClientDeploymentContext != null) {
                     try {
@@ -496,7 +495,6 @@
                 }
             }
 
-            earContext.addChildConfiguration(appClientConfigurationData);
         } catch (Throwable e) {
             File appClientDir = appClientDeploymentContext.getBaseDir();
             DeploymentUtil.recursiveDelete(appClientDir);

Modified: geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Sat Apr  1 18:01:40 2006
@@ -169,7 +169,8 @@
             try {
                 File planFile = new File(basedir, "src/test-data/data/external-application-plan.xml");
                 Object plan = configBuilder.getDeploymentPlan(planFile, rarFile);
-                configData = configBuilder.buildConfiguration(plan, rarFile, Collections.singleton(configurationStore), configurationStore);
+                List configurations = configBuilder.buildConfiguration(plan, rarFile, Collections.singleton(configurationStore), configurationStore);
+                configData = (ConfigurationData) configurations.get(0);
             } finally {
                 if (configData != null) {
                     DeploymentUtil.recursiveDelete(configData.getConfigurationDir());
@@ -597,7 +598,7 @@
             }
         }
 
-        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/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java (original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java Sat Apr  1 18:01:40 2006
@@ -95,11 +95,12 @@
                 return buildDir;
             }
 
-            public URL resolve(Artifact configId, URI uri) {
+            public URL resolve(Artifact configId, String moduleName, URI uri) {
                 return null;
             }
         };
-        ConfigurationData configurationData = builder.buildConfiguration(config, null, Collections.singleton(targetConfigurationStore), targetConfigurationStore);
+        List configurations = builder.buildConfiguration(config, null, Collections.singleton(targetConfigurationStore), targetConfigurationStore);
+        ConfigurationData configurationData = (ConfigurationData) configurations.get(0);
 
         JarOutputStream out = new JarOutputStream(new FileOutputStream(carFile));
         ExecutableConfigurationUtil.writeConfiguration(configurationData, out);

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java Sat Apr  1 18:01:40 2006
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.util.jar.JarFile;
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
@@ -58,9 +59,9 @@
      * @param module the module to build
      * @param configurationStores
      * @param targetConfigurationStore
-     * @return the Configuration information
+     * @return the configuration datas created from the deployment
      * @throws IOException if there was a problem reading or writing the files
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    ConfigurationData buildConfiguration(Object plan, JarFile module, Collection configurationStores, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException;
+    List buildConfiguration(Object plan, JarFile module, Collection configurationStores, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException;
 }

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java Sat Apr  1 18:01:40 2006
@@ -275,21 +275,32 @@
                 throw new DeploymentException("No ConfigurationStores!");
             }
             ConfigurationStore store = (ConfigurationStore) stores.iterator().next();
-            ConfigurationData configurationData = builder.buildConfiguration(plan, module, stores, store);
+            List configurations = builder.buildConfiguration(plan, module, stores, store);
+            if (configurations.isEmpty()) {
+                throw new DeploymentException("Deployer did not create any configuration");
+            }
             try {
                 if (targetFile != null) {
+                    if (configurations.size() > 1) {
+                        throw new DeploymentException("Deployer created more than one configuration");
+                    }
+                    ConfigurationData configurationData = (ConfigurationData) configurations.get(0);
                     ExecutableConfigurationUtil.createExecutableConfiguration(configurationData, manifest, targetFile);
                 }
                 if (install) {
                     List deployedURIs = new ArrayList();
-                    recursiveInstall(configurationData, deployedURIs, store);
+                    for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
+                        ConfigurationData configurationData = (ConfigurationData) iterator.next();
+                        store.install(configurationData);
+                        deployedURIs.add(configurationData.getId().toString());
+                    }
                     return deployedURIs;
                 } else {
-                    cleanupConfigurationDirs(configurationData);
+                    cleanupConfigurations(configurations);
                     return Collections.EMPTY_LIST;
                 }
             } catch (InvalidConfigException e) {
-                cleanupConfigurationDirs(configurationData);
+                cleanupConfigurations(configurations);
                 // unlikely as we just built this
                 throw new DeploymentException(e);
             }
@@ -319,24 +330,14 @@
         }
     }
 
-    private void cleanupConfigurationDirs(ConfigurationData configurationData) {
-        File configurationDir = configurationData.getConfigurationDir();
-        if (!DeploymentUtil.recursiveDelete(configurationDir)) {
-            pendingDeletionIndex.setProperty(configurationDir.getName(), "delete");
-            log.debug("Queued deployment directory to be reaped " + configurationDir);
-        }
-        for (Iterator iterator = configurationData.getChildConfigurations().iterator(); iterator.hasNext();) {
-            ConfigurationData data = (ConfigurationData) iterator.next();
-            cleanupConfigurationDirs(data);
-        }
-    }
-
-    private void recursiveInstall(ConfigurationData configurationData, List deployedURIs, ConfigurationStore store) throws IOException, InvalidConfigException {
-        store.install(configurationData);
-        deployedURIs.add(configurationData.getId().toString());
-        for (Iterator iterator = configurationData.getChildConfigurations().iterator(); iterator.hasNext();) {
-            ConfigurationData childConfiguration = (ConfigurationData) iterator.next();
-            recursiveInstall(childConfiguration, deployedURIs, store);
+    private void cleanupConfigurations(List configurations) {
+        for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
+            ConfigurationData configurationData = (ConfigurationData) iterator.next();
+            File configurationDir = configurationData.getConfigurationDir();
+            if (!DeploymentUtil.recursiveDelete(configurationDir)) {
+                pendingDeletionIndex.setProperty(configurationDir.getName(), "delete");
+                log.debug("Queued deployment directory to be reaped " + configurationDir);
+            }
         }
     }
 

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Sat Apr  1 18:01:40 2006
@@ -37,6 +37,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
+import java.util.LinkedHashMap;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -76,10 +77,11 @@
     private final File baseDir;
     private final URI baseUri;
     private final byte[] buffer = new byte[4096];
-    private final List childConfigurationDatas = new ArrayList();
+    private final Map childConfigurationDatas = new LinkedHashMap();
     private final ConfigurationManager configurationManager;
     private final Configuration configuration;
     private final Naming naming;
+    private final List additionalDeployment = new ArrayList();
 
     public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming) throws DeploymentException {
         this(baseDir,
@@ -132,15 +134,20 @@
         if (!baseDir.exists()) {
             baseDir.mkdirs();
         }
-        if (!baseDir.isDirectory()) {
-            throw new DeploymentException("Base directory is not a directory: " + baseDir.getAbsolutePath());
-        }
         this.baseDir = baseDir;
         this.baseUri = baseDir.toURI();
 
         this.naming = naming;
 
         this.configuration = createTempConfiguration(environment, moduleType, baseDir, configurationManager, naming);
+
+        if (baseDir.isFile()) {
+            try {
+                configuration.addToClassPath(URI.create(""));
+            } catch (IOException e) {
+                throw new DeploymentException(e);
+            }
+        }
     }
 
     private static ConfigurationManager createConfigurationManager(Collection repositories, Collection stores) {
@@ -451,8 +458,8 @@
         }
     }
 
-    public void addChildConfiguration(ConfigurationData configurationData) {
-        childConfigurationDatas.add(configurationData);
+    public void addChildConfiguration(String moduleName, ConfigurationData configurationData) {
+        childConfigurationDatas.put(moduleName, configurationData);
     }
 
     public ConfigurationData getConfigurationData() {
@@ -464,5 +471,13 @@
                 baseDir,
                 naming);
         return configurationData;
+    }
+
+    public void addAdditionalDeployment(ConfigurationData configurationData) {
+        additionalDeployment.add(configurationData);
+    }
+
+    public List getAdditionalDeployment() {
+        return additionalDeployment;
     }
 }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java Sat Apr  1 18:01:40 2006
@@ -16,21 +16,20 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.xmlbeans.XmlObject;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Collection;
 import java.util.jar.JarFile;
 
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.XmlObject;
+
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class AppClientModule extends Module {
     private final Environment clientEnvironment;
@@ -38,7 +37,7 @@
     private Collection resourceModules;
 
 
-    public AppClientModule(boolean standAlone, AbstractName moduleName, Environment serverEnvironment, Environment clientEnvironment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) throws DeploymentException {
+    public AppClientModule(boolean standAlone, AbstractName moduleName, Environment serverEnvironment, Environment clientEnvironment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         super(standAlone, moduleName, serverEnvironment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
         this.clientEnvironment = clientEnvironment;
     }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java Sat Apr  1 18:01:40 2006
@@ -16,23 +16,22 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.xmlbeans.XmlObject;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.jar.JarFile;
 
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.XmlObject;
+
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class ConnectorModule extends Module {
-    public ConnectorModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) throws DeploymentException {
+    public ConnectorModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         super(standAlone, moduleName, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
     }
 
@@ -43,6 +42,5 @@
     public void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {
         context.addClass(location, fqcn, bytes);
     }
-
 }
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Sat Apr  1 18:01:40 2006
@@ -73,6 +73,8 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
@@ -334,7 +336,7 @@
         return applicationInfo.getEnvironment().getConfigId();
     }
 
-    public ConfigurationData buildConfiguration(Object plan, JarFile earFile, Collection configurationStores, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
+    public List buildConfiguration(Object plan, JarFile earFile, Collection configurationStores, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
         assert plan != null;
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
         try {
@@ -432,9 +434,11 @@
                 getBuilder(module).addGBeans(earContext, module, cl, repositories);
             }
 
-            ConfigurationData configurationData = earContext.getConfigurationData();
+            List configurations = new ArrayList();
+            configurations.add(earContext.getConfigurationData());
+            configurations.addAll(earContext.getAdditionalDeployment());
             earContext.close();
-            return configurationData;
+            return configurations;
         } catch (GBeanAlreadyExistsException e) {
             throw new DeploymentException(e);
         } finally {

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java Sat Apr  1 18:01:40 2006
@@ -16,23 +16,22 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.xmlbeans.XmlObject;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.jar.JarFile;
 
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.XmlObject;
+
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class EJBModule extends Module {
-    public EJBModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) throws DeploymentException {
+    public EJBModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         super(standAlone, moduleName, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
     }
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java Sat Apr  1 18:01:40 2006
@@ -31,7 +31,7 @@
 import org.apache.geronimo.gbean.AbstractName;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public abstract class Module {
     private final boolean standAlone;
@@ -52,7 +52,7 @@
 
     private URI uniqueModuleLocation;
 
-    protected Module(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) throws DeploymentException {
+    protected Module(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) {
         assert targetPath != null: "targetPath is null";
         assert moduleName != null: "moduleName is null";
 
@@ -158,7 +158,7 @@
             File candidateFile;
             int i = 1;
             do {
-                candidateURI = URI.create(targetPath + "-generated" + suffix + "/");
+                candidateURI = URI.create("/META-INF/geronimo-generated" + suffix + "/");
                 candidateFile = context.getTargetFile(candidateURI);
                 suffix = "" + i++;
             } while (candidateFile.exists());

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java Sat Apr  1 18:01:40 2006
@@ -16,30 +16,26 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.xmlbeans.XmlObject;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.jar.JarFile;
 
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.XmlObject;
+
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class WebModule extends Module {
-
-    private final LinkedHashSet webClassPath = new LinkedHashSet();
     private final String contextRoot;
     private final Map portMap;
 
-    public WebModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String contextRoot, Map portMap, String namespace) throws DeploymentException {
+    public WebModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String contextRoot, Map portMap, String namespace) {
         super(standAlone, moduleName, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, namespace);
         this.contextRoot = contextRoot;
         this.portMap = portMap;

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Sat Apr  1 18:01:40 2006
@@ -264,7 +264,8 @@
                     naming);
 
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
         } finally {
             if (configurationData != null) {
                 DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
@@ -293,7 +294,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-ejb-jar.xml"), earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if (e.getCause() instanceof IOException) {
@@ -327,7 +329,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-war.xml"), earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if (e.getCause() instanceof IOException) {
@@ -361,7 +364,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-rar.xml"), earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if (e.getCause() instanceof IOException) {
@@ -395,7 +399,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-car.xml"), earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if (e.getCause() instanceof IOException) {
@@ -430,7 +435,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             // expected
@@ -462,7 +468,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             // expected
@@ -494,7 +501,8 @@
         ConfigurationData configurationData = null;
         try {
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configurationData = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            List configurations = configBuilder.buildConfiguration(plan, earFile, Collections.singleton(configStore), configStore);
+            configurationData = (ConfigurationData) configurations.get(0);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             // expected
@@ -548,7 +556,7 @@
             }
         }
 
-        public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException {
+        public URL resolve(Artifact configId, String moduleName, URI uri) throws NoSuchConfigException, MalformedURLException {
             File file = (File) locations.get(configId);
             if (file == null) {
                 throw new NoSuchConfigException("nothing for configid " + configId);

Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Sat Apr  1 18:01:40 2006
@@ -97,7 +97,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;
@@ -348,8 +347,6 @@
             Set securityRoles = collectRoleNames(webApp);
             Map rolePermissions = new HashMap();
 
-            webModuleData.setAttribute("uri", URI.create(module.getTargetPath() + "/"));
-
             String[] hosts = jettyWebApp.getVirtualHostArray();
             for (int i = 0; i < hosts.length; i++) {
                 hosts[i] = hosts[i].trim();
@@ -715,7 +712,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/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Sat Apr  1 18:01:40 2006
@@ -338,7 +338,7 @@
             }
         }
 
-        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/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java Sat Apr  1 18:01:40 2006
@@ -252,7 +252,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 (IllegalArgumentException) new IllegalArgumentException("Unable to look up connectors for Jetty container '"+containerName).initCause(e);
         }
     }
 

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java Sat Apr  1 18:01:40 2006
@@ -75,7 +75,7 @@
 /**
  * Wrapper for a WebApplicationContext that sets up its J2EE environment.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 386763 $ $Date$
  */
 public class JettyWebAppContext extends WebApplicationContext implements GBeanLifecycle, JettyServletRegistration, WebModule {
     private static Log log = LogFactory.getLog(JettyWebAppContext.class);
@@ -154,45 +154,43 @@
     }
 
     public JettyWebAppContext(String objectName,
-                              String originalSpecDD,
-                              URI uri,
-                              String[] virtualHosts,
-                              String sessionManager,
-                              Map componentContext,
-                              OnlineUserTransaction userTransaction,
-                              ClassLoader classLoader,
-                              URL configurationBaseUrl,
-                              Set unshareableResources,
-                              Set applicationManagedSecurityResources,
-
-                              String displayName,
-                              Map contextParamMap,
-                              Collection listenerClassNames,
-                              boolean distributable,
-                              Map mimeMap,
-                              String[] welcomeFiles,
-                              Map localeEncodingMapping,
-                              Map errorPages,
-                              Authenticator authenticator,
-                              String realmName,
-                              Map tagLibMap,
-                              int sessionTimeoutSeconds,
-
-                              String policyContextID,
-                              String securityRealmName,
-                              DefaultPrincipal defaultPrincipal,
-                              PermissionCollection checkedPermissions,
-                              PermissionCollection excludedPermissions,
-
-                              TransactionContextManager transactionContextManager,
-                              TrackedConnectionAssociator trackedConnectionAssociator,
-                              JettyContainer jettyContainer,
-                              RoleDesignateSource roleDesignateSource,
-                              J2EEServer server,
-                              J2EEApplication application,
-                              Kernel kernel) throws Exception, IllegalAccessException, InstantiationException, ClassNotFoundException {
+            String originalSpecDD,
+            String[] virtualHosts,
+            String sessionManager,
+            Map componentContext,
+            OnlineUserTransaction userTransaction,
+            ClassLoader classLoader,
+            URL configurationBaseUrl,
+            Set unshareableResources,
+            Set applicationManagedSecurityResources,
+
+            String displayName,
+            Map contextParamMap,
+            Collection listenerClassNames,
+            boolean distributable,
+            Map mimeMap,
+            String[] welcomeFiles,
+            Map localeEncodingMapping,
+            Map errorPages,
+            Authenticator authenticator,
+            String realmName,
+            Map tagLibMap,
+            int sessionTimeoutSeconds,
+
+            String policyContextID,
+            String securityRealmName,
+            DefaultPrincipal defaultPrincipal,
+            PermissionCollection checkedPermissions,
+            PermissionCollection excludedPermissions,
+
+            TransactionContextManager transactionContextManager,
+            TrackedConnectionAssociator trackedConnectionAssociator,
+            JettyContainer jettyContainer,
+            RoleDesignateSource roleDesignateSource,
+            J2EEServer server,
+            J2EEApplication application,
+            Kernel kernel) throws Exception, IllegalAccessException, InstantiationException, ClassNotFoundException {
 
-        assert uri != null;
         assert componentContext != null;
         assert userTransaction != null;
         assert classLoader != null;
@@ -215,7 +213,7 @@
 
         setConfigurationClassNames(new String[]{});
 
-        webAppRoot = new URL(configurationBaseUrl, uri.toString()).toString();
+        webAppRoot = configurationBaseUrl.toString();
         this.webClassLoader = classLoader;
         setClassLoader(this.webClassLoader);
 
@@ -576,7 +574,6 @@
         infoBuilder.addAttribute("sessionTimeoutSeconds", int.class, true);
 
 
-        infoBuilder.addAttribute("uri", URI.class, true);
         infoBuilder.addAttribute("virtualHosts", String[].class, true);
         infoBuilder.addAttribute("sessionManager", String.class, true);
         infoBuilder.addAttribute("componentContext", Map.class, true);
@@ -617,7 +614,6 @@
         infoBuilder.setConstructor(new String[]{
                 "objectName",
                 "deploymentDescriptor",
-                "uri",
                 "virtualHosts",
                 "sessionManager",
                 "componentContext",

Modified: geronimo/branches/1.1/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java Sat Apr  1 18:01:40 2006
@@ -38,7 +38,6 @@
 import org.mortbay.http.Authenticator;
 import org.mortbay.jetty.servlet.FormAuthenticator;
 
-import java.net.URI;
 import java.net.URL;
 import java.security.PermissionCollection;
 import java.util.Collections;
@@ -49,7 +48,7 @@
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386763 $ $Date$
  */
 public class AbstractWebModuleTest extends TestCase {
     protected ClassLoader cl;
@@ -88,13 +87,12 @@
 
         JettyWebAppContext app = new JettyWebAppContext(null,
                 null,
-                URI.create(uriString),
                 null,
                 null,
                 Collections.EMPTY_MAP,
                 new OnlineUserTransaction(),
                 cl,
-                configurationBaseURL,
+                new URL(configurationBaseURL, uriString),
                 null,
                 null,
                 "context",

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java Sat Apr  1 18:01:40 2006
@@ -28,7 +28,7 @@
 import org.apache.geronimo.kernel.management.State;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386907 $ $Date$
  */
 public final class GBeanDependency {
 
@@ -65,6 +65,10 @@
         listener = createLifecycleListener();
     }
 
+    public AbstractName getTargetName() {
+        return targetName;
+    }
+
     public final synchronized void online() {
         //TODO consider including interfaces in query
         AbstractNameQuery query = new AbstractNameQuery(targetName, null);
@@ -187,8 +191,9 @@
 
         final GBeanDependency that = (GBeanDependency) o;
 
-        if (gbeanInstance != null ? !gbeanInstance.equals(that.gbeanInstance) : that.gbeanInstance != null)
+        if (gbeanInstance != null ? !gbeanInstance.equals(that.gbeanInstance) : that.gbeanInstance != null) {
             return false;
+        }
         return !(targetName != null ? !targetName.equals(that.targetName) : that.targetName != null);
 
     }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Sat Apr  1 18:01:40 2006
@@ -27,6 +27,9 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.LinkedHashSet;
+import java.io.StringWriter;
+import java.io.PrintWriter;
 
 import javax.management.ObjectName;
 
@@ -194,8 +197,13 @@
      */
     private boolean shouldFail = false;
 
+    /**
+     * Used to track instance
+     */
     private InstanceRegistry instanceRegistry;
 
+    private String stateReason;
+
     /**
      * Construct a GBeanMBean using the supplied GBeanData and class loader
      *
@@ -403,7 +411,7 @@
         manageableStore = null;
     }
 
-    public void setInstanceRegistry(InstanceRegistry instanceRegistry) {
+    public synchronized void setInstanceRegistry(InstanceRegistry instanceRegistry) {
         this.instanceRegistry = instanceRegistry;
     }
 
@@ -436,6 +444,14 @@
     }
 
     /**
+     * Gets the reason we are in the current state.
+     * @return the reason we are in the current state
+     */
+    public String getStateReason() {
+        return stateReason;
+    }
+
+    /**
      * The java type of the wrapped gbean instance
      *
      * @return the java type of the gbean
@@ -849,19 +865,34 @@
             } else if (instanceState == DESTROYING) {
                 // this should never ever happen... this method is protected by the GBeanState class which should
                 // prevent stuff like this happening, but check anyway
+                stateReason = "an internal error has occurred.  An was made to start an instance that was still stopping which is an illegal state transition.";
                 throw new IllegalStateException("A stopping instance can not be started until fully stopped");
             }
             assert instanceState == DESTROYED;
 
+            stateReason = null;
+
             // Call all start on every reference.  This way the dependecies are held until we can start
-            boolean allStarted = true;
+            LinkedHashSet unstarted = new LinkedHashSet();
             for (int i = 0; i < dependencies.length; i++) {
-                allStarted = dependencies[i].start() && allStarted;
+                if (!dependencies[i].start()) {
+                    unstarted.add(dependencies[i].getTargetName());
+                }
             }
             for (int i = 0; i < references.length; i++) {
-                allStarted = references[i].start() && allStarted;
+                if (!references[i].start()) {
+                    if (references[i] instanceof GBeanSingleReference) {
+                        GBeanSingleReference reference = (GBeanSingleReference) references[i];
+                        unstarted.add(reference.getTargetName());
+                    }
+                }
             }
-            if (!allStarted) {
+            if (!unstarted.isEmpty()) {
+                if (unstarted.size() == 1) {
+                    stateReason = unstarted.iterator().next() + " did not start.";
+                } else {
+                    stateReason = "the following dependent services did not start: " + unstarted;
+                }
                 return false;
             }
 
@@ -888,6 +919,7 @@
                 } else if (referenceIndex.containsKey(name)) {
                     parameters[i] = getReferenceByName(name).getProxy();
                 } else {
+                    stateReason = "the service constructor definition contained the name '" + name + "' which is not a known attribute or reference of the service.";
                     throw new InvalidConfigurationException("Unknown attribute or reference name in constructor: name=" + name);
                 }
             }
@@ -902,8 +934,10 @@
                 } else if (targetException instanceof Error) {
                     throw (Error) targetException;
                 }
+                stateReason = "the service constructor threw an exception. \n" + printException(e);
                 throw e;
             } catch (IllegalArgumentException e) {
+                stateReason = "the service constructor threw an exception due to a parameter type mismatch. \n" + printException(e);
                 log.warn("Constructor mismatch for " + abstractName, e);
                 throw e;
             }
@@ -918,18 +952,33 @@
             // inject the persistent attribute value into the new instance
             for (int i = 0; i < attributes.length; i++) {
                 checkIfShouldFail();
-                attributes[i].inject(instance);
+                try {
+                    attributes[i].inject(instance);
+                } catch (Exception e) {
+                    stateReason = "the setter for attribute '" + attributes[i].getName() + "' threw an exception. \n" + printException(e);
+                    throw e;
+                }
             }
 
             // inject the proxies into the new instance
             for (int i = 0; i < references.length; i++) {
                 checkIfShouldFail();
-                references[i].inject(instance);
+                try {
+                    references[i].inject(instance);
+                } catch (Exception e) {
+                    stateReason = "the setter for reference '" + references[i].getName() + "' threw an exception. \n" + printException(e);
+                    throw e;
+                }
             }
 
             if (instance instanceof GBeanLifecycle) {
                 checkIfShouldFail();
-                ((GBeanLifecycle) instance).doStart();
+                try {
+                    ((GBeanLifecycle) instance).doStart();
+                } catch (Exception e) {
+                    stateReason = "the doStart method threw an exception. \n" + printException(e);
+                    throw e;
+                }
             }
 
 
@@ -944,6 +993,7 @@
             }
 
 
+            stateReason = null;
             return true;
         } catch (Throwable t) {
             // something went wrong... we need to destroy this instance
@@ -987,6 +1037,14 @@
         }
     }
 
+    private String printException(Throwable t) {
+        StringWriter stringWriter = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(stringWriter);
+        t.printStackTrace(printWriter);
+        printWriter.flush();
+        return stringWriter.toString();
+    }
+
     private synchronized void checkIfShouldFail() throws Exception {
         if (shouldFail) {
             shouldFail = false;
@@ -1022,7 +1080,8 @@
                 return false;
             }
             assert instanceState == RUNNING;
-
+            stateReason = null;
+            
             // we are definately going to stop... if this fails the must clean up these variables
             instanceState = DESTROYING;
             instance = target;
@@ -1177,7 +1236,7 @@
 
     public boolean equals(Object obj) {
         if (obj == this) return true;
-        if (obj instanceof GBeanInstance == false) return false;
+        if (!(obj instanceof GBeanInstance)) return false;
         return abstractName.equals(((GBeanInstance) obj).abstractName);
     }
 

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java Sat Apr  1 18:01:40 2006
@@ -35,11 +35,15 @@
     /**
      * The object to which the proxy is bound
      */
-    private final AbstractName proxyTarget;
+    private final AbstractName targetName;
 
     public GBeanSingleReference(GBeanInstance gbeanInstance, GReferenceInfo referenceInfo, Kernel kernel, ReferencePatterns referencePatterns) throws InvalidConfigurationException {
         super(gbeanInstance, referenceInfo, kernel, referencePatterns != null && referencePatterns.getAbstractName() != null);
-        proxyTarget = referencePatterns != null? referencePatterns.getAbstractName(): null;
+        targetName = referencePatterns != null? referencePatterns.getAbstractName(): null;
+    }
+
+    public AbstractName getTargetName() {
+        return targetName;
     }
 
     public final synchronized void online() {
@@ -52,14 +56,14 @@
 
     public synchronized boolean start() {
         // We only need to start if there are patterns and we don't already have a proxy
-        if (proxyTarget == null) {
+        if (targetName == null) {
             return true;
         }
 
         // assure the gbean is running
         AbstractName abstractName = getGBeanInstance().getAbstractName();
-        if (!isRunning(getKernel(), proxyTarget)) {
-            log.debug("Waiting to start " + abstractName + " because no targets are running for reference " + getName() +" matching the patterns " + proxyTarget);
+        if (!isRunning(getKernel(), targetName)) {
+            log.debug("Waiting to start " + abstractName + " because no targets are running for reference " + getName() +" matching the patterns " + targetName);
             return false;
         }
 
@@ -69,13 +73,13 @@
 
         if (NO_PROXY) {
             try {
-                setProxy(getKernel().getGBean(proxyTarget));
+                setProxy(getKernel().getGBean(targetName));
             } catch (GBeanNotFoundException e) {
                 // gbean disappeard on us
-                log.debug("Waiting to start " + abstractName + " because no targets are running for reference " + getName() +" matching the patterns " + proxyTarget);
+                log.debug("Waiting to start " + abstractName + " because no targets are running for reference " + getName() +" matching the patterns " + targetName);
             }
         } else {
-            setProxy(getKernel().getProxyManager().createProxy(proxyTarget, getReferenceType()));
+            setProxy(getKernel().getProxyManager().createProxy(targetName, getReferenceType()));
         }
 
         return true;

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java Sat Apr  1 18:01:40 2006
@@ -722,4 +722,17 @@
         }
         return new GBeanName(objectName);
     }
+
+
+    /**
+     * @deprecated Experimental feature
+     */
+    public String getStateReason(AbstractName abstractName) {
+        try {
+            GBeanInstance gbeanInstance = registry.getGBeanInstance(abstractName);
+            return gbeanInstance.getStateReason();
+        } catch (GBeanNotFoundException e) {
+            return null;
+        }
+    }
 }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java Sat Apr  1 18:01:40 2006
@@ -121,6 +121,7 @@
      * The registered abstractName for this configuraion.
      */
     private final AbstractName abstractName;
+
     /**
      * Defines the environment requred for this configuration.
      */
@@ -171,9 +172,17 @@
      */
     private final Naming naming;
 
+    /**
+     * Environment, classpath, gbeans and other data for this configuration.
+     */
     private ConfigurationData configurationData;
 
     /**
+     * The nested configurations of this configuration.
+     */
+    List children = new ArrayList();
+
+    /**
      * Only used to allow declaration as a reference.
      */
     public Configuration() {
@@ -259,6 +268,19 @@
             GBeanData gbeanData = (GBeanData) iterator.next();
             this.gbeans.put(gbeanData.getAbstractName(), gbeanData);
         }
+
+        //
+        // Create child configurations
+        //
+        LinkedHashSet childParents = new LinkedHashSet(parents);
+        childParents.add(this);
+        for (Iterator iterator = configurationData.getChildConfigurations().entrySet().iterator(); iterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            String moduleName = (String) entry.getKey();
+            ConfigurationData childConfigurationData = (ConfigurationData) entry.getValue();
+            Configuration childConfiguration = new Configuration(childParents, childConfigurationData, configurationResolver.createChildResolver(moduleName));
+            children.add(childConfiguration);
+        }
     }
 
     private MultiParentClassLoader createConfigurationClasssLoader(Collection parents, Environment environment, LinkedHashSet classPath) throws MalformedURLException, MissingDependencyException, NoSuchConfigException {
@@ -402,7 +424,6 @@
     public void addToClassPath(URI path) throws IOException {
         if (!classPath.contains(path)) {
             try {
-                configurationResolver.resolve(path);
                 URL url = configurationResolver.resolve(path);
                 configurationClassLoader.addURL(url);
                 classPath.add(path);
@@ -429,6 +450,14 @@
     }
 
     /**
+     * Gets the nested configurations of this configuration.
+     * @return the nested configuration of this configuration
+     */
+    public List getChildren() {
+        return Collections.unmodifiableList(children);
+    }
+
+    /**
      * Gets an unmodifiable collection of the GBeanDatas for the GBeans in this configuration.
      * @return the GBeans in this configuration
      */
@@ -615,6 +644,11 @@
     }
 
     private void shutdown() {
+        for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+            Configuration configuration = (Configuration) iterator.next();
+            configuration.shutdown();
+        }
+
         // clear references to GBeanDatas
         gbeans.clear();
 

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java Sat Apr  1 18:01:40 2006
@@ -30,6 +30,8 @@
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Iterator;
+import java.util.Map;
+import java.util.LinkedHashMap;
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
@@ -73,7 +75,7 @@
     /**
      * Child configurations of this configuration
      */
-    private final List childConfigurations = new ArrayList();
+    private final Map childConfigurations = new LinkedHashMap();
 
     /**
      * The base file of the configuation
@@ -98,7 +100,7 @@
         this(null, null, null, null, environment, null, naming);
     }
 
-    public ConfigurationData(ConfigurationModuleType moduleType, LinkedHashSet classPath, List gbeans, List childConfigurations, Environment environment, File configurationDir, Naming naming) {
+    public ConfigurationData(ConfigurationModuleType moduleType, LinkedHashSet classPath, List gbeans, Map childConfigurations, Environment environment, File configurationDir, Naming naming) {
         if (naming == null) throw new NullPointerException("naming is null");
         this.naming = naming;
         if (moduleType != null) {
@@ -113,7 +115,7 @@
             this.gbeans.addAll(gbeans);
         }
         if (childConfigurations != null) {
-            this.childConfigurations.addAll(childConfigurations);
+            this.childConfigurations.putAll(childConfigurations);
         }
 
         if (environment == null) throw new NullPointerException("environment is null");
@@ -163,8 +165,8 @@
         return gBeanData;
     }
 
-    public List getChildConfigurations() {
-        return Collections.unmodifiableList(childConfigurations);
+    public Map getChildConfigurations() {
+        return Collections.unmodifiableMap(childConfigurations);
     }
 
     public Environment getEnvironment() {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationResolver.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationResolver.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationResolver.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationResolver.java Sat Apr  1 18:01:40 2006
@@ -41,12 +41,18 @@
     private final Artifact configurationId;
     private final ArtifactResolver artifactResolver;
     private final Collection repositories;
+
     /**
      * file or configstore used to resolve classpath parts
      */
     private final File baseDir;
     private final ConfigurationStore configurationStore;
 
+    /**
+     * For nested configurations, the module name will be non-null.
+     */
+    private final String moduleName;
+
     public ConfigurationResolver(Artifact configurationId, File baseDir) {
         if (configurationId == null)  throw new NullPointerException("configurationId is null");
 
@@ -55,6 +61,7 @@
         artifactResolver = null;
         repositories = Collections.EMPTY_SET;
         configurationStore = null;
+        moduleName = null;
     }
 
     public ConfigurationResolver(ConfigurationData configurationData, Collection repositories, ArtifactResolver artifactResolver) {
@@ -66,6 +73,29 @@
         this.repositories = repositories;
         configurationStore = configurationData.getConfigurationStore();
         baseDir = configurationData.getConfigurationDir();
+        moduleName = null;
+    }
+
+    private ConfigurationResolver(Artifact configurationId, ArtifactResolver artifactResolver, Collection repositories, File baseDir, ConfigurationStore configurationStore, String moduleName) {
+        this.configurationId = configurationId;
+        this.artifactResolver = artifactResolver;
+        this.repositories = repositories;
+        this.baseDir = baseDir;
+        this.configurationStore = configurationStore;
+        this.moduleName = moduleName;
+    }
+
+    public ConfigurationResolver createChildResolver(String moduleName) {
+        if (moduleName == null) throw new NullPointerException("moduleName is null");
+        if (this.moduleName != null) {
+            moduleName = this.moduleName + '/' + moduleName;
+        }
+
+        File childBaseDir = null;
+        if (baseDir != null) {
+            childBaseDir = new File(baseDir, moduleName);
+        }
+        return new ConfigurationResolver(configurationId, artifactResolver, repositories, childBaseDir, configurationStore, moduleName);
     }
 
     public File resolve(Artifact artifact) throws MissingDependencyException {
@@ -81,7 +111,7 @@
 
     public URL resolve(URI uri) throws MalformedURLException, NoSuchConfigException {
         if (configurationStore != null) {
-            return configurationStore.resolve(configurationId, uri);
+            return configurationStore.resolve(configurationId, moduleName, uri);
         } else if (baseDir != null) {
             return new File(baseDir, uri.toString()).toURL();
         } else {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java Sat Apr  1 18:01:40 2006
@@ -92,8 +92,9 @@
     /**
      * Locate the classpath component for the supplied uri in the given artifact
      * @param configId
+     * @param moduleName
      * @param uri
      * @return URL for the configuration component.
      */
-    URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException;
+    URL resolve(Artifact configId, String moduleName, URI uri) throws NoSuchConfigException, MalformedURLException;
 }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Sat Apr  1 18:01:40 2006
@@ -29,6 +29,7 @@
 import java.util.Set;
 import java.util.List;
 import java.util.Collections;
+import java.util.ArrayList;
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -40,6 +41,7 @@
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.basic.BasicKernel;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 
@@ -80,10 +82,8 @@
 
         Configuration configuration = (Configuration) kernel.getGBean(gbeanData.getAbstractName());
 
-        // get the gbeans and classloader
-        Collection gbeans = configuration.getGBeans().values();
-
-        startConfigurationGBeans(gbeans, configuration, kernel);
+        // start the gbeans
+        startConfigurationGBeans(configuration.getAbstractName(), configuration, kernel, null);
 
         ConfigurationManager configurationManager = getConfigurationManager(kernel);
         configurationManager.loadConfiguration(configId);
@@ -165,7 +165,7 @@
         kernel.getProxyManager().destroyProxy(configurationManager);
     }
 
-    static void preprocessGBeanData(Configuration configuration, GBeanData gbeanData) throws InvalidConfigException {
+    static void preprocessGBeanData(AbstractName configurationName, Configuration configuration, GBeanData gbeanData) throws InvalidConfigException {
         for (Iterator references = gbeanData.getReferencesNames().iterator(); references.hasNext();) {
             String referenceName = (String) references.next();
             GReferenceInfo referenceInfo = gbeanData.getGBeanInfo().getReference(referenceName);
@@ -211,10 +211,15 @@
         }
 
         // add a dependency from the gbean to the configuration
-        gbeanData.addDependency(configuration.getAbstractName());
+        gbeanData.addDependency(configurationName);
     }
 
-    static void startConfigurationGBeans(Collection gbeans, Configuration configuration, Kernel kernel) throws InvalidConfigException {
+    static void startConfigurationGBeans(AbstractName configurationName, Configuration configuration, Kernel kernel, ManageableAttributeStore attributeStore) throws InvalidConfigException {
+        Collection gbeans = configuration.getGBeans().values();
+        if (attributeStore != null) {
+            gbeans = attributeStore.applyOverrides(configuration.getId(), gbeans, configuration.getConfigurationClassLoader());
+        }
+
         // register all the GBeans
         for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
             GBeanData gbeanData = (GBeanData) iterator.next();
@@ -223,8 +228,7 @@
             gbeanData = new GBeanData(gbeanData);
 
             // preprocess the gbeanData (resolve references, set base url, declare dependency, etc.)
-            preprocessGBeanData(configuration, gbeanData);
-//            log.trace("Registering GBean " + gbeanData.getName());
+            preprocessGBeanData(configurationName, configuration, gbeanData);
 
             try {
                 kernel.loadGBean(gbeanData, configuration.getConfigurationClassLoader());
@@ -242,15 +246,39 @@
             }
 
             // assure all of the gbeans are started
+            List unstarted = new ArrayList();
             for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
                 GBeanData gbeanData = (GBeanData) iterator.next();
                 AbstractName gbeanName = gbeanData.getAbstractName();
                 if (State.RUNNING_INDEX != kernel.getGBeanState(gbeanName)) {
-                    throw new InvalidConfigurationException("Configuration " + configuration.getId() + " failed to start because gbean " + gbeanName + " did not start");
+                    String stateReason = null;
+                    if (kernel instanceof BasicKernel) {
+                        stateReason = ((BasicKernel) kernel).getStateReason(gbeanName);
+                    }
+                    String name = gbeanName.toURI().getQuery();
+                    if (stateReason != null) {
+                        unstarted.add("The service " + name + " did not start because " + stateReason);
+                    } else {
+                        unstarted.add("The service " + name + " did not start for an unknown reason");
+                    }
                 }
             }
+            if (!unstarted.isEmpty()) {
+                StringBuffer message = new StringBuffer();
+                message.append("Configuration ").append(configuration.getId()).append(" failed to start due to the following reasons:\n");
+                for (Iterator iterator = unstarted.iterator(); iterator.hasNext();) {
+                    String reason = (String) iterator.next();
+                    message.append("  ").append(reason).append("\n");
+                }
+                throw new InvalidConfigurationException(message.toString());
+            }
         } catch (GBeanNotFoundException e) {
             throw new InvalidConfigException(e);
+        }
+
+        for (Iterator iterator = configuration.getChildren().iterator(); iterator.hasNext();) {
+            Configuration childConfiguration = (Configuration) iterator.next();
+            ConfigurationUtil.startConfigurationGBeans(configurationName, childConfiguration, kernel, attributeStore);
         }
         // todo clean up after failure
     }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java?rev=390769&r1=390768&r2=390769&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java Sat Apr  1 18:01:40 2006
@@ -83,7 +83,7 @@
 
 
             // preprocess the gbean data before loading it into the kernel
-            ConfigurationUtil.preprocessGBeanData(configuration, gbean);
+            ConfigurationUtil.preprocessGBeanData(configuration.getAbstractName(), configuration, gbean);
 
             // register the bean with the kernel
             kernel.loadGBean(gbean, configurationClassLoader);