java零基础 第三代半导体 kubeflow 数据结构 细胞因子 百度搜索优化 全局重载运算符 reflection io vue下载 vue网站 bootstrap后台管理系统 easyui视频 jquery的each遍历方法 pr序列设置哪个好 java文件写入 java接口的使用 java基础课程 java的for循环 java时间转换 java中instanceof java读取文本 h5模板 linux格式化命令 迷宫解锁 xp画图工具 decimalformat allowoverride 马赛克软件 音频录制软件 咪咕客户端下载 ezcad2 战地联盟辅助 getelementbyid skycc组合营销软件 dnf传说装备 c4d文字 vue定时器 只狼台词 diskman
当前位置: 首页 > 学习教程  > 编程语言

shiro+ehcache出现的问题

2020/11/24 10:02:42 文章标签: 测试文章如有侵权请发送至邮箱809451989@qq.com投诉后文章立即删除

目录 shiro ehcache 问题一:Initial cause was null:30: Element does not allow nested elements. 解决方式: 问题二: Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or c…

目录

shiro + ehcache 

问题一:Initial cause was null:30: Element does not allow nested elements.

解决方式:

问题二: Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary

解决方式:


shiro + ehcache 

 

问题一:Initial cause was null:30: Element <ehcache> does not allow nested <ehcache> elements.

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shiroFilterFactoryBean' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'shiroFilterFactoryBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodInvokingFactoryBean' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'methodInvokingFactoryBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityManager' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'securityManager' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [com/yang/config/cache/EhCacheConfig.class]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Error configuring from input stream. Initial cause was null:30: Element <ehcache> does not allow nested <ehcache> elements.

解决方式:

说的是 <ehcache> 标签中 不允许存在 <ehcache> 标签,即不能出现标签套标签的情况

找到 ehcache.xml 文件  <ehcache> 标签 将里面的标签进行修改为 <cache>

 

 

问题二: Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodInvokingFactoryBean' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'methodInvokingFactoryBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shiroFilterFactoryBean' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'shiroFilterFactoryBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityManager' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'securityManager' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource [com/yang/config/shiro/ShiroConfig.class]: Unsatisfied dependency expressed through method 'cacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [com/yang/config/cache/EhCacheConfig.class]: Invocation of init method failed; nested exception is 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 ]

解决方式:

1.可以将 ehcache 版本修改为 2.5版本以下,

2.我再项目运行的时候,好像直接进行重启造成的,我先将项目停止让后再次启动没有出现这种问题(但是后面在问题重新的时候,无法重现。无语.........)

 

 


本文链接: http://www.dtmao.cc/news_show_400217.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?