Index: StandardManager.java =================================================================== --- StandardManager.java (rivison 568181) +++ StandardManager.java (working copy) @@ -345,46 +345,30 @@ return; if (log.isDebugEnabled()) log.debug(sm.getString("standardManager.loading", pathname)); - FileInputStream fis = null; - ObjectInputStream ois = null; - Loader loader = null; - ClassLoader classLoader = null; - try { - fis = new FileInputStream(file.getAbsolutePath()); - BufferedInputStream bis = new BufferedInputStream(fis); - if (container != null) - loader = container.getLoader(); - if (loader != null) - classLoader = loader.getClassLoader(); - if (classLoader != null) { - if (log.isDebugEnabled()) - log.debug("Creating custom object input stream for class loader "); - ois = new CustomObjectInputStream(bis, classLoader); - } else { - if (log.isDebugEnabled()) - log.debug("Creating standard object input stream"); - ois = new ObjectInputStream(bis); - } - } catch (FileNotFoundException e) { - if (log.isDebugEnabled()) - log.debug("No persisted data file found"); - return; - } catch (IOException e) { - log.error(sm.getString("standardManager.loading.ioe", e), e); - if (ois != null) { - try { - ois.close(); - } catch (IOException f) { - ; - } - ois = null; - } - throw e; - } // Load the previously unloaded active sessions synchronized (sessions) { + FileInputStream fis = null; + ObjectInputStream ois = null; + Loader loader = null; + ClassLoader classLoader = null; try { + fis = new FileInputStream(file.getAbsolutePath()); + BufferedInputStream bis = new BufferedInputStream(fis); + if (container != null) + loader = container.getLoader(); + if (loader != null) + classLoader = loader.getClassLoader(); + if (classLoader != null) { + if (log.isDebugEnabled()) + log.debug("Creating custom object input stream for class loader "); + ois = new CustomObjectInputStream(bis, classLoader); + } else { + if (log.isDebugEnabled()) + log.debug("Creating standard object input stream"); + ois = new ObjectInputStream(bis); + } + Integer count = (Integer) ois.readObject(); int n = count.intValue(); if (log.isDebugEnabled()) @@ -397,27 +381,15 @@ session.activate(); session.endAccess(); } + } catch (FileNotFoundException e) { + if (log.isDebugEnabled()) + log.debug("No persisted data file found"); + return; } catch (ClassNotFoundException e) { - log.error(sm.getString("standardManager.loading.cnfe", e), e); - if (ois != null) { - try { - ois.close(); - } catch (IOException f) { - ; - } - ois = null; - } + log.error(sm.getString("standardManager.loading.cnfe", e), e); throw e; } catch (IOException e) { - log.error(sm.getString("standardManager.loading.ioe", e), e); - if (ois != null) { - try { - ois.close(); - } catch (IOException f) { - ; - } - ois = null; - } + log.error(sm.getString("standardManager.loading.ioe", e), e); throw e; } finally { // Close the input stream