尝试用ehcache.xml在wildfly10中实现ehcache
将ehcache.jar文件作为模块添加,并添加依赖项,如下所述:
<resources>
<resource-root path="ehcache-1.2.2.jar"/>
</resources>
<dependencies>
<module name="org.apache.commons.logging"/>
<module name="org.apache.log4j"/>
<module name="javax.xml.parsers"/>
</dependencies>
</module>当我试图运行服务器war文件时,我会得到以下错误。
从d:\ehcache.xml中配置错误。最初的原因是输入流配置错误。最初的原因是__redirected.__SAXParserFactory不能转换为javax.xml.parsers.SAXParserFactory
任何线索都会有帮助。
StackTrace:
发布于 2017-05-15 14:39:38
您似乎使用了Ehcache 1,这个版本真的很老了。您至少应该升级到Ehcache 2,最新的版本是Ehcache 3,很可能Ehcache 1与当前的Java版本和通配符依赖项不兼容。
发布于 2017-05-18 10:12:37
它与EhCache 3.3.1一起工作
字符串cacheName = "basicCacheNamit";
try (CacheManager cacheManager = newCacheManagerBuilder()
.withCache(cacheName,
newCacheConfigurationBuilder(Long.class, String.class, heap(100).offheap(1, MB)))
.build(true)) {
Cache<Long, String> basicCache = cacheManager.getCache(cacheName, Long.class, String.class);
basicCache.put(1L, "da one!");
String value = basicCache.get(1L);https://stackoverflow.com/questions/43886501
复制相似问题