我的项目有hibernate l2缓存,并使用ehcache来管理这个配置
hibernate.cache.region.factory_class:org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
迁移到Spring boot 2后,我得到了这个异常
Caused by: java.lang.annotation.IncompleteAnnotationException: org.terracotta.statistics.Statistic missing element type
at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:81)
at com.sun.proxy.$Proxy151.type(Unknown Source)
at org.terracotta.statistics.StatisticsManager.parseStatisticAnnotations(StatisticsManager.java:114)
at org.terracotta.context.ContextManager.contextCreated(ContextManager.java:183)
at org.terracotta.context.ContextManager.getOrCreateTreeNode(ContextManager.java:136)
at org.terracotta.context.ContextManager.associate(ContextManager.java:114)
at org.terracotta.context.ContextManager.access$000(ContextManager.java:38)
at org.terracotta.context.ContextManager$1.withChild(ContextManager.java:57)
at org.terracotta.statistics.StatisticsManager.createOperationStatistic(StatisticsManager.java:55)
at org.terracotta.statistics.StatisticsManager.createOperationStatistic(StatisticsManager.java:50)
at net.sf.ehcache.statistics.StatisticBuilder$OperationStatisticBuilder.build(StatisticBuilder.java:79)
at net.sf.ehcache.Cache.<init>(Cache.java:268)
at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:305)
at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:223)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:783)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:470)
at net.sf.ehcache.CacheManager.init(CacheManager.java:394)
... 42 common frames omitted
在问了一些问题后,我发现ehcache都是2x和3x 有我的项目和异常原因是,但当排除2x。看到春天需要启动2 x。如何解决这个问题
答案 0 :(得分:1)
通过替换:
解决了这个问题 <dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
以下内容:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
AS OF SPRING BOOT 2.0.2
删除:
spring.jpa.properties.hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.EhCacheRegionFactory
删除:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
答案 1 :(得分:0)
使用修复了问题,
render