• Bug
  • Status: Closed
  • Resolution: Fixed
  • drb
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • September 22, 2009
  • September 22, 2009

Description

At startup on windows, I’ve got index file, but ehcache can’t read it, and can’t create new one. I suggest you to close FileInputStream before createNewIndexFile.

refactor of readIndex :

private synchronized void readIndex() throws IOException { if (indexFile.exists()) { ObjectInputStream objectInputStream = null; try { FileInputStream fin = new FileInputStream(indexFile); objectInputStream = new ObjectInputStream(fin); diskElements = (HashMap) objectInputStream.readObject(); freeSpace = (ArrayList) objectInputStream.readObject(); } catch (StreamCorruptedException e) { LOG.error(“Corrupt index file. Creating new index. “, e); } catch (IOException e) { LOG.error(“IOException reading index. Creating new index.”, e); } catch (ClassNotFoundException e) { LOG.error(“Class loading problem reading index. Creating new index.”, e); } finally { if (objectInputStream != null) { objectInputStream.close(); } //Zero out file. If there is a dirty shutdown, the file will be empty. createNewIndexFile(); } } createNewIndexFile(); }

Sourceforge Ticket ID: 1075320 - Opened By: dwayneb - 29 Nov 2004 15:39 UTC

Comments

Sourceforge Tracker 2009-09-21

Logged In: YES user_id=693320

I seem to remember doing something on this. I think I applied the patch but did not close here in the list. Comment by: gregluck - 7 Mar 2005 01:11 UTC

Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira