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

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

    In my case Problem is component-scan and java config.

    root-context.xml
    
    
    servlet-context.xml
    
    

    spring component-scan work two times on xml files. it generate beans inside SpringConfig.java each run time. then duplicate cache manager was created.

    so, I changed that like below.

    root-context.xml
    
            
    
    
    servlet-context.xml
    
            
    
    

提交回复
热议问题