You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by js...@apache.org on 2006/07/31 16:08:14 UTC
svn commit: r427120 -
/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Author: jsisson
Date: Mon Jul 31 07:08:13 2006
New Revision: 427120
URL: http://svn.apache.org/viewvc?rev=427120&view=rev
Log:
GERONIMO-1996 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/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=427120&r1=427119&r2=427120&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 Mon Jul 31 07:08:13 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) {
Re: svn commit: r427120 - /geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On 7/31/06, Bill Stoddard <bi...@wstoddard.com> wrote:
> Is this correct?
The actual cleanup is done in a finally block.
Thanks,
Aaron
Re: svn commit: r427120 - /geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Posted by Bill Stoddard <bi...@wstoddard.com>.
Aaron Mulder wrote:
> Hurray!
>
> Thanks,
> Aaron
>
> On 7/31/06, jsisson@apache.org <js...@apache.org> wrote:
>> Author: jsisson
>> Date: Mon Jul 31 07:08:13 2006
>> New Revision: 427120
>>
>> URL: http://svn.apache.org/viewvc?rev=427120&view=rev
>> Log:
>> GERONIMO-1996 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/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
>>
>>
>> Modified:
>> geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
>>
>> URL:
>> http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=427120&r1=427119&r2=427120&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
>> Mon Jul 31 07:08:13 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;
>> }
Is this correct?
Bill
Re: svn commit: r427120 - /geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Hurray!
Thanks,
Aaron
On 7/31/06, jsisson@apache.org <js...@apache.org> wrote:
> Author: jsisson
> Date: Mon Jul 31 07:08:13 2006
> New Revision: 427120
>
> URL: http://svn.apache.org/viewvc?rev=427120&view=rev
> Log:
> GERONIMO-1996 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/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
>
> Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
> URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=427120&r1=427119&r2=427120&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 Mon Jul 31 07:08:13 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) {
>
>
>