You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/08/04 20:29:10 UTC

svn commit: r428826 - in /geronimo/sandbox/svkmerge/m2migration/modules/deployment/src: ./ java/org/apache/geronimo/deployment/Deployer.java

Author: jdillon
Date: Fri Aug  4 11:29:10 2006
New Revision: 428826

URL: http://svn.apache.org/viewvc?rev=428826&view=rev
Log:
 r617@jason-dillons-computer (orig r427986):  jdillon | 2006-08-02 07:12:20 -0700
  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/m2migration/modules/deployment/src/   (props changed)
    geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java

Propchange: geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Aug  4 11:29:10 2006
@@ -1 +1 @@
-13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/deployment/src:426508
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/deployment/src:427986

Modified: geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=428826&r1=428825&r2=428826&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java Fri Aug  4 11:29:10 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) {