geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r427986 - in /geronimo/sandbox/svkmerge/trunk: ./ modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Date Wed, 02 Aug 2006 14:12:21 GMT
Author: jdillon
Date: Wed Aug  2 07:12:20 2006
New Revision: 427986

URL: http://svn.apache.org/viewvc?rev=427986&view=rev
Log:
 r602@dyn456093 (orig r427123):  jsisson | 2006-07-31 07:16:46 -0700
 GERONIMO-1996 (merged from 1.1 branch) Fix cleanup of configurations when Errors occur. 
Previously an Error such as a  java.lang.ExceptionInInitializerError during Serialization
during deployment leaves files in the repository and possibly leaves things in a state where
you cannot undeploy.

Modified:
    geronimo/sandbox/svkmerge/trunk/   (props changed)
    geronimo/sandbox/svkmerge/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java

Propchange: geronimo/sandbox/svkmerge/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Wed Aug  2 07:12:20 2006
@@ -1,2 +1,2 @@
 13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/m2migration:419395
-13f79535-47bb-0310-9956-ffa450edef68:/geronimo/trunk:426681
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/trunk:427123

Modified: geronimo/sandbox/svkmerge/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=427986&r1=427985&r2=427986&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/sandbox/svkmerge/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Wed Aug  2 07:12:20 2006
@@ -301,6 +301,7 @@
             // It's our responsibility to close this context, once we're done with it...
             DeploymentContext context = builder.buildConfiguration(inPlace, configID, plan,
module, stores, artifactResolver, store);
             List configurations = new ArrayList();
+            boolean configsCleanupRequired = false;
             configurations.add(context.getConfigurationData());
             configurations.addAll(context.getAdditionalDeployment());
 
@@ -334,23 +335,31 @@
                     notifyWatchers(deployedURIs);
                     return deployedURIs;
                 } else {
-                    cleanupConfigurations(configurations);
+                    configsCleanupRequired = true;
                     return Collections.EMPTY_LIST;
                 }
             } catch (DeploymentException e) {
-                cleanupConfigurations(configurations);
+                configsCleanupRequired = true;
                 throw e;
             } catch (IOException e) {
-                cleanupConfigurations(configurations);
+                configsCleanupRequired = true;
                 throw e;
             } catch (InvalidConfigException e) {
-                cleanupConfigurations(configurations);
+                configsCleanupRequired = true;
                 // unlikely as we just built this
                 throw new DeploymentException(e);
+            } catch (Throwable e) {
+                // Could get here if serialization of the configuration failed (GERONIMO-1996)
+                configsCleanupRequired = true;
+                throw e;
             } finally {
                 thread.setContextClassLoader(oldCl);
                 if (context != null) {
                     context.close();
+                }
+                if (configsCleanupRequired) {
+                    // We do this after context is closed so the module jar isn't open
+                    cleanupConfigurations(configurations);
                 }
             }
         } catch (Throwable e) {



Mime
View raw message