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

前端 未结 17 1973
囚心锁ツ
囚心锁ツ 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:12

    if you just test your business service,not second level cache,you can remove second level configuration in your spring config file,your test will be run successfully. there is my second level configuration :

     
            
            
            
            
                
                    ${hibernate.dialect}
                    false
                    
                    false
                    false
                
            
        
    

    if i change to full configuration of second level cache config ,the real webapp use in running time,like this:

        
                
                
                
                
                    
                        ${hibernate.dialect}
                        false
                        
                        true
                        true
                        net.sf.ehcache.hibernate.EhCacheRegionFactory               
                        ehcache/ehcache-hibernate-local.xml
                    
                
            
    

    then i get the same Exception "Another unnamed CacheManager already exists in the same VM"

提交回复
热议问题