Another unnamed CacheManager already exists in the same VM (ehCache 2.5)

前端 未结 17 1968
囚心锁ツ
囚心锁ツ 2020-11-30 20:41

This is what happens when I run my junit tests...

Another CacheManager with same name \'cacheManager\' already exists in the same VM. Please 
provide unique          


        
17条回答
  •  星月不相逢
    2020-11-30 21:00

    It happened to me when switching to Spring Boot 2.0.2. Resolved it by doing the following:

    REMOVE in application.yml

    spring.jpa.properties.hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
    

    REMOVE in pom.xml

    
        net.sf.ehcache
        ehcache
    
    

    KEEP in pom.xml only

    
        org.hibernate
        hibernate-ehcache
    
    

提交回复
热议问题