* do not continue with bootstrap if ehcache location could not be created and locked

This commit is contained in:
Reinhard Pointner 2014-12-12 18:24:38 +00:00
parent 2d4ef1602c
commit 98577cff6b
1 changed files with 2 additions and 5 deletions

View File

@ -410,7 +410,7 @@ public class Main {
/** /**
* Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk * Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk
*/ */
private static void initializeCache() { private static void initializeCache() throws Exception {
// prepare cache folder for this application instance // prepare cache folder for this application instance
File cacheRoot = getApplicationCache(); File cacheRoot = getApplicationCache();
@ -491,11 +491,8 @@ public class Main {
channel.close(); channel.close();
} }
} catch (Exception e) { } catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.toString(), e); throw new Exception("Failed to initialize cache: " + e.toString(), e);
} }
// use cache root itself as fail-safe fallback
System.setProperty("ehcache.disk.store.dir", new File(cacheRoot, "default").getAbsolutePath());
} }
/** /**