diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/ExplodingOutputtingInputStream.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/ExplodingOutputtingInputStream.java
index 0cf664a..0604353 100644
--- a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/ExplodingOutputtingInputStream.java
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/ExplodingOutputtingInputStream.java
@@ -136,7 +136,7 @@
                 writer.close();
             }
         }
-        
+
         try {
             byte[] buffer = new byte[1024];
             int c = m_input.read(buffer);
@@ -158,7 +158,7 @@
             }
         }
     }
-    
+
     private void pushException(Exception e) {
         Exception e2 = new Exception(e.getMessage());
         e2.setStackTrace(e.getStackTrace());
@@ -171,7 +171,7 @@
     public static boolean replace(File target, File source) {
         return delete(target, true) && rename(source, target);
     }
-    
+
     public static boolean copy(File from, File to) {
         boolean result = true;
         if (from.isDirectory()) {
@@ -223,7 +223,7 @@
         }
         return result;
     }
-    
+
     public static boolean rename(File from, File to) {
         if (!from.renameTo(to)) {
             if (copy(from, to)) {
@@ -265,7 +265,7 @@
         List result = new ArrayList(targetFiles);
 
         File manifestFile = new File(source, (String) sourceFiles.remove(0));
-        Manifest resultManifest = new Manifest(new GZIPInputStream(new FileInputStream(manifestFile)));
+        Manifest resultManifest = Utils.readManifest(manifestFile);
 
         resultManifest.getMainAttributes().remove(new Name(Constants.DEPLOYMENTPACKAGE_FIXPACK));
 
diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/FileDeploymentPackage.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/FileDeploymentPackage.java
index 8d5f4dc..64341de 100644
--- a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/FileDeploymentPackage.java
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/FileDeploymentPackage.java
@@ -53,27 +53,11 @@
     }
 
     private FileDeploymentPackage(List index, File packageDir, BundleContext bundleContext, DeploymentAdminImpl deploymentAdmin) throws DeploymentException, IOException {
-        super(readManifest(index, packageDir), bundleContext, deploymentAdmin);
+        super(Utils.readManifest(new File(packageDir, (String) index.remove(0))), bundleContext, deploymentAdmin);
         m_index = index;
         m_contentsDir = packageDir;
     }
 
-    private static Manifest readManifest(List index, File packageDir) throws FileNotFoundException, IOException {
-        final File manifestFile = new File(packageDir, (String) index.remove(0));
-        InputStream is = null;
-        Manifest mf = null;
-        try {
-            is = new GZIPInputStream(new FileInputStream(manifestFile));
-            mf = new Manifest(is);
-        }
-        finally {
-            if (is != null) {
-                is.close();
-            }
-        }
-        return mf;
-    }
-
     public BundleInfoImpl[] getOrderedBundleInfos() {
         List result = new ArrayList();
         for(Iterator i = m_index.iterator(); i.hasNext();) {
diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Utils.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Utils.java
new file mode 100644
index 0000000..aa9c94a
--- /dev/null
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Utils.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.deploymentadmin;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.Manifest;
+import java.util.zip.GZIPInputStream;
+
+public class Utils {
+    public static Manifest readManifest(File manifestFile) throws IOException {
+        InputStream is = null;
+        Manifest mf = null;
+        try {
+            is = new GZIPInputStream(new FileInputStream(manifestFile));
+            mf = new Manifest(is);
+        }
+        finally {
+            if (is != null) {
+                is.close();
+            }
+        }
+        return mf;
+    }
+}
diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/DropBundleCommand.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/DropBundleCommand.java
index ce74ba7..3f2ddd3 100644
--- a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/DropBundleCommand.java
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/DropBundleCommand.java
@@ -47,37 +47,47 @@
                 try {
                     Bundle bundle = target.getBundle(symbolicName);
                     bundle.uninstall();
-                    addRollback(new InstallBundleRunnable(bundle, target.getBundleStream(symbolicName), log));
+                    addRollback(new InstallBundleRunnable(bundle, target, log));
                 }
                 catch (BundleException be) {
                     log.log(LogService.LOG_WARNING, "Bundle '" + symbolicName + "' could not be uninstalled", be);
                 }
-                catch (IOException e) {
-                    log.log(LogService.LOG_WARNING, "Could not get bundle data stream for bundle '" + symbolicName + "'", e);
-                    throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Could not prepare rollback for uninstalling bundle '" + symbolicName + "'");
-                }
             }
         }
     }
 
     private static class InstallBundleRunnable implements Runnable {
 
-        private final InputStream m_bundleStream;
+        private final AbstractDeploymentPackage m_target;
         private final Bundle m_bundle;
         private final LogService m_log;
 
-        public InstallBundleRunnable(Bundle bundle, InputStream bundleStream, LogService log) {
+        public InstallBundleRunnable(Bundle bundle, AbstractDeploymentPackage target, LogService log) {
             m_bundle = bundle;
-            m_bundleStream = bundleStream;
+            m_target = target;
             m_log = log;
         }
 
         public void run() {
+            InputStream is = null;
             try {
-                m_bundle.update(m_bundleStream);
+                is = m_target.getBundleStream(m_bundle.getSymbolicName());
+                if (is != null) {
+                    m_bundle.update(is);
+                }
+                throw new Exception("Unable to get Inputstream for bundle " + m_bundle.getSymbolicName());
             }
-            catch (BundleException e) {
-                m_log.log(LogService.LOG_WARNING, "Could not rollback uninstallation of bundle '" + m_bundle.getSymbolicName() + "'", e);
+            catch (Exception e) {
+                m_log.log(LogService.LOG_WARNING,
+                    "Could not rollback uninstallation of bundle '" + m_bundle.getSymbolicName() + "'", e);
+            }
+            finally {
+                if (is != null) {
+                    try {
+                        is.close();
+                    }
+                    catch (IOException e) {}
+                }
             }
         }
     }
diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/UpdateCommand.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/UpdateCommand.java
index 14e5cf3..5159d29 100644
--- a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/UpdateCommand.java
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/UpdateCommand.java
@@ -32,6 +32,7 @@
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Version;
 import org.osgi.service.deploymentadmin.DeploymentException;
+import org.osgi.service.log.LogService;
 
 /**
  * Command that installs all bundles described in the source deployment package of a deployment
@@ -44,6 +45,7 @@
         AbstractDeploymentPackage source = session.getSourceAbstractDeploymentPackage();
         AbstractDeploymentPackage targetPackage = session.getTargetAbstractDeploymentPackage();
         BundleContext context = session.getBundleContext();
+        LogService log = session.getLog();
 
         Map expectedBundles = new HashMap();
         AbstractInfo[] bundleInfos = (AbstractInfo[]) source.getBundleInfos();
@@ -72,14 +74,14 @@
                     if (bundle == null) {
                         // new bundle, install it
                         bundle = context.installBundle(Constants.BUNDLE_LOCATION_PREFIX + bundleInfo.getSymbolicName(), new BundleInputStream(source.getCurrentEntryStream()));
-                        addRollback(new UninstallBundleRunnable(bundle));
+                        addRollback(new UninstallBundleRunnable(bundle, log));
                     } else {
                         // existing bundle, update it
                         Version sourceVersion = bundleInfo.getVersion();
                         Version targetVersion = Version.parseVersion((String) bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION));
                         if (!sourceVersion.equals(targetVersion)) {
                             bundle.update(new BundleInputStream(source.getCurrentEntryStream()));
-                            addRollback(new UpdateBundleRunnable(bundle, targetPackage, bundleInfo.getSymbolicName()));
+                            addRollback(new UpdateBundleRunnable(bundle, targetPackage, log));
                         }
                     }
                 }
@@ -102,9 +104,11 @@
     private static class UninstallBundleRunnable implements Runnable {
 
         private final Bundle m_bundle;
+        private final LogService m_log;
 
-        public UninstallBundleRunnable(Bundle bundle) {
+        public UninstallBundleRunnable(Bundle bundle, LogService log) {
             m_bundle = bundle;
+            m_log = log;
         }
 
         public void run() {
@@ -112,31 +116,43 @@
                 m_bundle.uninstall();
             }
             catch (BundleException e) {
-                // TODO: log this
-                e.printStackTrace();
+                m_log.log(LogService.LOG_WARNING, "Could not rollback update of bundle '" + m_bundle.getSymbolicName() + "'", e);
             }
         }
     }
 
     private static class UpdateBundleRunnable implements Runnable {
 
-        private final Bundle m_bundle;
         private final AbstractDeploymentPackage m_targetPackage;
-        private final String m_symbolicName;
+        private final Bundle m_bundle;
+        private final LogService m_log;
 
-        public UpdateBundleRunnable(Bundle bundle, AbstractDeploymentPackage targetPackage, String symbolicName) {
+        public UpdateBundleRunnable(Bundle bundle, AbstractDeploymentPackage targetPackage, LogService log) {
             m_bundle = bundle;
             m_targetPackage = targetPackage;
-            m_symbolicName = symbolicName;
+            m_log = log;
         }
 
         public void run() {
+            InputStream is = null;
             try {
-                m_bundle.update(m_targetPackage.getBundleStream(m_symbolicName));
+                is = m_targetPackage.getBundleStream(m_bundle.getSymbolicName());
+                if(is != null){
+                    m_bundle.update(is);                    
+                }
+                throw new Exception("Unable to get Inputstream for bundle " + m_bundle.getSymbolicName());
             }
             catch (Exception e) {
-                // TODO: log this
-                e.printStackTrace();
+                m_log.log(LogService.LOG_WARNING, "Could not rollback update of bundle '" + m_bundle.getSymbolicName() + "'", e);
+            } finally {
+                if(is != null){
+                    try {
+                        is.close();
+                    }
+                    catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
             }
         }
     }
