缓存ehcache启动失败Factory method ‘ehCacheCacheManager‘ threw exception

缓存ehcache启动失败Factory method ‘ehCacheCacheManager‘ threw exception,第1张

缓存ehcache启动失败Factory method ‘ehCacheCacheManager‘ threw exception

启动失败了,报了如下错误

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheCacheManager' defined in class path resource [org/springframework/boot/autoconfigure/cache/EhCacheCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.sf.ehcache.CacheManager]: Factory method 'ehCacheCacheManager' threw exception; nested exception is net.sf.ehcache.CacheException: java.lang.annotation.IncompleteAnnotationException: org.terracotta.statistics.Statistic missing element type

以前一直在用,没有问题,新项目报错。

新项目唯一不同的是使用了easyexcel得错误生成pom

查看easyexcel的pom.xml,找到了这个

        
            com.github.duanyashu
            easyExcel-errorExport
            1.1.1   
        

基本上定位问题所在了,org.ehcache和net.sf.ehcache有冲突,那么既然easyexcel已经引用了,我们就去掉net.sf.ehcache。

然后依然报错,有了新的提示,告诉我们无法连接redis,懂了。

那么我们尝试一下用net.sf.ehcache,排除org.ehcache。

 
            com.github.duanyashu
            easyExcel-errorExport
            1.1.1
            
                
                    org.ehcache
                    ehcache
                
            
 

启动成功了。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5705712.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存