geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r392818 - in /geronimo/branches/1.1: configs/jetty-deployer/src/plan/ modules/deployment/src/java/org/apache/geronimo/deployment/ modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ modules/kernel/src/java/org/apache/geronimo...
Date Sun, 09 Apr 2006 19:51:52 GMT
Author: dain
Date: Sun Apr  9 12:51:46 2006
New Revision: 392818

URL: http://svn.apache.org/viewcvs?rev=392818&view=rev
Log:
Redeploy from the command line now works for the console application.
Fixed problem where every servlet running in the server was being added as a default servlet
to new web applications.
Fixed several problems with installing new deployments into the config store.

Modified:
    geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.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/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java

Modified: geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml?rev=392818&r1=392817&r2=392818&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml Sun Apr  9 12:51:46 2006
@@ -28,10 +28,14 @@
         <attribute name="defaultContextPriorityClassloader">false</attribute>
         <attribute name="defaultWelcomeFiles">index.html,index.htm,index.jsp</attribute>
         <attribute name="jettyContainerObjectName">?name=JettyWebContainer</attribute>
-        <reference name="DefaultServlets">
-            <!--gbean-name>geronimo.maven:j2eeType=DefaultServlet,J2EEModule=${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car,*</gbean-name-->
-            <!--<name>*</name>-->
-        </reference>
+        <references name="DefaultServlets">
+            <pattern>
+                <name>StaticContent</name>
+            </pattern>
+            <pattern>
+                <name>JSPServlet</name>
+            </pattern>
+        </references>
         <reference name="PojoWebServiceTemplate">
             <name>POJOTemplate</name>
         </reference>

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=392818&r1=392817&r2=392818&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
Sun Apr  9 12:51:46 2006
@@ -299,6 +299,12 @@
                     cleanupConfigurations(configurations);
                     return Collections.EMPTY_LIST;
                 }
+            } catch (DeploymentException e) {
+                cleanupConfigurations(configurations);
+                throw e;
+            } catch (IOException e) {
+                cleanupConfigurations(configurations);
+                throw e;
             } catch (InvalidConfigException e) {
                 cleanupConfigurations(configurations);
                 // unlikely as we just built this

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=392818&r1=392817&r2=392818&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
Sun Apr  9 12:51:46 2006
@@ -338,18 +338,20 @@
     public List buildConfiguration(Object plan, JarFile earFile, Collection configurationStores,
ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
         assert plan != null;
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
+
+        EARContext earContext;
+        ConfigurationModuleType applicationType = applicationInfo.getType();
+        Environment environment = applicationInfo.getEnvironment();
+        Artifact configId = environment.getConfigId();
+        File configurationDir;
+        try {
+            configurationDir = targetConfigurationStore.createNewConfigurationDir(configId);
+        } catch (ConfigurationAlreadyExistsException e) {
+            throw new DeploymentException(e);
+        }
+
         try {
             // Create the output ear context
-            EARContext earContext;
-            ConfigurationModuleType applicationType = applicationInfo.getType();
-            Environment environment = applicationInfo.getEnvironment();
-            Artifact configId = environment.getConfigId();
-            File configurationDir;
-            try {
-                configurationDir = targetConfigurationStore.createNewConfigurationDir(configId);
-            } catch (ConfigurationAlreadyExistsException e) {
-                throw new DeploymentException(e);
-            }
             earContext = new EARContext(configurationDir,
                     applicationInfo.getEnvironment(),
                     applicationType,
@@ -439,7 +441,21 @@
             earContext.close();
             return configurations;
         } catch (GBeanAlreadyExistsException e) {
+            // todo delete owned configuraitons like appclients
+            DeploymentUtil.recursiveDelete(configurationDir);
             throw new DeploymentException(e);
+        } catch (IOException e) {
+            DeploymentUtil.recursiveDelete(configurationDir);
+            throw e;
+        } catch (DeploymentException e) {
+            DeploymentUtil.recursiveDelete(configurationDir);
+            throw e;
+        } catch(RuntimeException e) {
+            DeploymentUtil.recursiveDelete(configurationDir);
+            throw e;
+        } catch(Error e) {
+            DeploymentUtil.recursiveDelete(configurationDir);
+            throw e;
         } finally {
             Set modules = applicationInfo.getModules();
             for (Iterator iterator = modules.iterator(); iterator.hasNext();) {

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=392818&r1=392817&r2=392818&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
Sun Apr  9 12:51:46 2006
@@ -167,46 +167,46 @@
         }
     }
 
-    protected void stop(Configuration configuration) throws InvalidConfigException {
+    protected void stop(Configuration configuration) {
+        stopRecursive(configuration);
+        if (configurationList != null) {
+            configurationList.removeConfiguration(configuration.getId().toString());
+        }
+    }
+
+    private void stopRecursive(Configuration configuration) {
         // stop all of the child configurations first
         for (Iterator iterator = configuration.getChildren().iterator(); iterator.hasNext();)
{
             Configuration childConfiguration = (Configuration) iterator.next();
-            stop(childConfiguration);
+            stopRecursive(childConfiguration);
         }
 
-        try {
-            Collection gbeans = configuration.getGBeans().values();
+        Collection gbeans = configuration.getGBeans().values();
 
-            // stop the gbeans
-            for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
-                GBeanData gbeanData = (GBeanData) iterator.next();
-                AbstractName gbeanName = gbeanData.getAbstractName();
-                try {
-                    kernel.stopGBean(gbeanName);
-                } catch (GBeanNotFoundException ignored) {
-                } catch (IllegalStateException ignored) {
-                } catch (InternalKernelException kernelException) {
-                    log.debug("Error cleaning up after failed start of configuration " +
configuration.getId() + " gbean " + gbeanName, kernelException);
-                }
+        // stop the gbeans
+        for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
+            GBeanData gbeanData = (GBeanData) iterator.next();
+            AbstractName gbeanName = gbeanData.getAbstractName();
+            try {
+                kernel.stopGBean(gbeanName);
+            } catch (GBeanNotFoundException ignored) {
+            } catch (IllegalStateException ignored) {
+            } catch (InternalKernelException kernelException) {
+                log.debug("Error cleaning up after failed start of configuration " + configuration.getId()
+ " gbean " + gbeanName, kernelException);
             }
+        }
 
-            // unload the gbeans
-            for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
-                GBeanData gbeanData = (GBeanData) iterator.next();
-                AbstractName gbeanName = gbeanData.getAbstractName();
-                try {
-                    kernel.unloadGBean(gbeanName);
-                } catch (GBeanNotFoundException ignored) {
-                } catch (IllegalStateException ignored) {
-                } catch (InternalKernelException kernelException) {
-                    log.debug("Error cleaning up after failed start of configuration " +
configuration.getId() + " gbean " + gbeanName, kernelException);
-                }
+        // unload the gbeans
+        for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
+            GBeanData gbeanData = (GBeanData) iterator.next();
+            AbstractName gbeanName = gbeanData.getAbstractName();
+            try {
+                kernel.unloadGBean(gbeanName);
+            } catch (GBeanNotFoundException ignored) {
+            } catch (IllegalStateException ignored) {
+            } catch (InternalKernelException kernelException) {
+                log.debug("Error cleaning up after failed start of configuration " + configuration.getId()
+ " gbean " + gbeanName, kernelException);
             }
-        } catch (Exception e) {
-            throw new InvalidConfigException("Could not stop gbeans in configuration", e);
-        }
-        if (configurationList != null) {
-            configurationList.removeConfiguration(configuration.getId().toString());
         }
     }
 

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=392818&r1=392817&r2=392818&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
Sun Apr  9 12:51:46 2006
@@ -400,7 +400,7 @@
         }
     }
 
-    protected void stop(Configuration configuration) throws InvalidConfigException {
+    protected void stop(Configuration configuration) {
         throw new UnsupportedOperationException();
     }
 

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=392818&r1=392817&r2=392818&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
Sun Apr  9 12:51:46 2006
@@ -77,7 +77,7 @@
     public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException,
IOException, InvalidConfigException {
         File location = repository.getLocation(configId);
 
-        if (!location.exists() && location.canRead()) {
+        if (!location.exists() && !location.canRead()) {
             throw new NoSuchConfigException("Configuration not found: " + configId);
         }
 
@@ -204,24 +204,24 @@
         File destination = repository.getLocation(configId);
 
         // if directory in the correct place -- noop
-        if (source.equals(destination)) {
-            return;
-        }
+        if (!source.equals(destination)) {
+            if (destination.exists()) {
+                throw new ConfigurationAlreadyExistsException(configId.toString());
+            }
 
-        if (destination.exists()) {
-            throw new ConfigurationAlreadyExistsException(configId.toString());
+            if (source.isFile()) {
+                // Assume this is a jar file
+                // copy it into the repository; repository should unpack it
+                repository.copyToRepository(source, configId, null);
+            } else if (source.isDirectory()) {
+                // directory is in wrong place -- directory copy
+                IOUtil.recursiveCopy(source, destination);
+            } else {
+                throw new InvalidConfigException("Unable to install configuration from "
+ source);
+            }
         }
 
-        if (source.isFile()) {
-            // Assume this is a jar file
-            // copy it into the repository; repository should unpack it
-            repository.copyToRepository(source, configId, null);
-        } else if (source.isDirectory()) {
-            // directory is in wrong place -- directory copy
-            IOUtil.recursiveCopy(source, destination);
-        } else {
-            throw new InvalidConfigException("Unable to install configuration from " + source);
-        }
+        ExecutableConfigurationUtil.writeConfiguration(configurationData, destination);
     }
 
     public void uninstall(Artifact configId) throws NoSuchConfigException, IOException {



Mime
View raw message