hibernate 二级缓存 和 管理 session的错误

出现了这样 的报错
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:

  1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
  2. Shutdown the earlier cacheManager before creating new one with same name.
    The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]

在我测试openSession(); 是否为新的时候

  CustomerDao CC= new CustomerDao(); 
  CC.save(null);
  CC.save(null);
  CC.save(null);

Another unnamed CacheManager already exists in the same VM.解决方法
https://blog.csdn.net/xionglangs/article/details/71557290