URL url = this.getClass().getClassLoader().getResource("ehcache.xml");
String path = url.getFile();
_cacheManager = CacheManager.create(path);
修改方法一:直接使用url
URL url = this.getClass().getClassLoader().getResource("ehcache.xml");
_cacheManager = CacheManager.create(url);
修改方法二:使用InputStream
InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("ehcache.xml");
_cacheManager = CacheManager.create(resourceAsStream);