public void tearDown() throws Exception { log.info("Relasing cache " + nc.getCacheName()); try { CacheFactory.releaseCache(nc); nc = null; } catch (IllegalStateException e) { if (e.getMessage() != null && e.getMessage().indexOf("Cache is already released") >= 0) { log.info("This cache was already destroyed by another instance"); } } CacheFactory.shutdown(); log.info("Cache factory was shut down."); }