Spring项目加入Shiro报错
报错信息
Error initializing bean [cacheManager]; nested exception is org.apache.shiro.cache.CacheException: net.sf.ehcache.config.InvalidConfigurationException: There are 3 errors in your configuration:
* Cache ‘authenticationCache’ error: If your CacheManager has no maxBytesLocalHeap set, you need to either set maxEntriesLocalHeap or maxBytesLocalHeap at the Cache level
* Cache ‘authorizationCache’ error: If your CacheManager has no maxBytesLocalHeap set, you need to either set maxEntriesLocalHeap or maxBytesLocalHeap at the Cache level
* Cache ‘shiro-activeSessionCache’ error: If your CacheManager has no maxBytesLocalHeap set, you need to either set maxEntriesLocalHeap or maxBytesLocalHeap at the Cache level
*
初始化 bean [cacheManager] 时出错;嵌套异常是 org.apache.shiro.cache.CacheException: net.sf.ehcache.config.InvalidConfigurationException: 配置中有 3 个错误:
* Cache ‘authenticationCache’ 错误:如果您的 CacheManager 没有设置 maxBytesLocalHeap,则需要在缓存级别设置 maxEntriesLocalHeap 或 maxBytesLocalHeap
* Cache ‘authorizationCache’ 错误:如果你的 CacheManager 没有设置 maxBytesLocalHeap,你需要在缓存级别设置 maxEntriesLocalHeap 或 maxBytesLocalHeap
* Cache ‘shiro-activeSessionCache’ 错误:如果你的 CacheManager 没有设置 maxBytesLocalHeap,你需要在缓存级别设置 maxEntriesLocalHeap 或 maxBytesLocalHeap
解决办法
将原来的ehcache.xml替换为下边的代码
```xml
<?xml version="1.0" encoding="UTF-8"?>