You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dw...@apache.org on 2009/01/12 17:58:13 UTC

svn commit: r733839 - /geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java

Author: dwoods
Date: Mon Jan 12 08:57:54 2009
New Revision: 733839

URL: http://svn.apache.org/viewvc?rev=733839&view=rev
Log:
GERONIMO-4420 Create Files under repository even if fail to deploy a jar having problems.  Applied patch from Ivan.

Modified:
    geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java?rev=733839&r1=733838&r2=733839&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java Mon Jan 12 08:57:54 2009
@@ -28,6 +28,7 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
@@ -316,13 +317,7 @@
             ConfigurationStore store,
             DeploymentContext context) throws DeploymentException, IOException, Throwable {
         List<ConfigurationData> configurations = new ArrayList<ConfigurationData>();
-        configurations.add(context.getConfigurationData());
-        configurations.addAll(context.getAdditionalDeployment());
-
-        if (configurations.isEmpty()) {
-            throw new DeploymentException("Deployer did not create any configurations");
-        }
-
+        
         boolean configsCleanupRequired = false;
 
         // Set TCCL to the classloader for the configuration being deployed
@@ -334,6 +329,25 @@
         ClassLoader oldCl = thread.getContextClassLoader();
         thread.setContextClassLoader( context.getConfiguration().getConfigurationClassLoader());
         try {
+            try {
+                configurations.add(context.getConfigurationData());
+            } catch (DeploymentException e) {
+                Configuration configuration = context.getConfiguration(); 
+                if (configuration != null) {
+                    ConfigurationData dumbConfigurationData = new ConfigurationData(null, null, null, null,
+                            configuration.getEnvironment(), context.getBaseDir(), null, context.getNaming());
+                    configurations.add(dumbConfigurationData);
+                }
+                configurations.addAll(context.getAdditionalDeployment());
+                throw e;
+            }
+            
+            configurations.addAll(context.getAdditionalDeployment());
+
+            if (configurations.isEmpty()) {
+                throw new DeploymentException("Deployer did not create any configurations");
+            }
+
             if (targetFile != null) {
                 if (configurations.size() > 1) {
                     throw new DeploymentException("Deployer created more than one configuration");