FELIX-3284 Prevent excpetions masking the actual problem if the bundle update fails. Write to stderr if logging fails
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1220640 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BaseUpdateInstallHelper.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BaseUpdateInstallHelper.java
index 654faf4..fb7a60b 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BaseUpdateInstallHelper.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BaseUpdateInstallHelper.java
@@ -129,9 +129,21 @@
{ bundle } );
}
}
- catch ( Exception ioe )
+ catch ( Exception e )
{
- getLog().log( LogService.LOG_ERROR, "Cannot install or update bundle from " + bundleFile, ioe );
+ try
+ {
+ getLog().log( LogService.LOG_ERROR, "Cannot install or update bundle from " + bundleFile, e );
+ }
+ catch ( Exception secondary )
+ {
+ // at the time this exception happens the log used might have
+ // been destroyed and is not available to use any longer. So
+ // we only can write to stderr at this time to at least get
+ // some message out ...
+ System.err.println( "Cannot install or update bundle from " + bundleFile );
+ e.printStackTrace( System.err );
+ }
}
finally
{