关于Springboot 中注入多个cacheManage 时候 存在报错
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [applicationContext-ehcache.xml]: 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 ]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:320)
... 76 more
背景:
注入了redis ehcache 和自定义的ehcahe
这时候cachemanager 存在以上异常
解决办法
,share修改为true。这样EhCacheManagerFactoryBean内部在得到shared信息就不会重复重复创建cache了。
关于Springboot 中注入多个cacheManage 时候 存在报错的更多相关文章
- Springboot解决资源文件404,503等特殊报错,无法访问
Springboot解决资源文件404,503等特殊报错 原文链接:https://www.cnblogs.com/blog5277/p/9324609.html 原文作者:博客园--曲高终和寡 ** ...
- springboot 2.1.6.RELEASE pom 第一行报错
eclipse创建springboot 2.1.6.RELEASE pom第一行报错 在pom.xml 文件的properties中加入maven jar插件的版本号 <maven-jar-p ...
- springboot x.x.x RELEASE pom 第一行报错解决办法
springboot x.x.x RELEASE pom 第一行报错解决办法 在pom.xml 文件的properties中加入maven jar插件的版本号 <properties> & ...
- php中读取中文文件夹及文件报错
php读取时出现中文乱码 一般php输出中出现中文乱码我们可用 header ('content:text/html;charset="utf-8"'); php中读取中文文件夹及 ...
- javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决
javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决 在做移动端时间转化为时间戳时,遇到了一个问题,安卓手机上访问时,能拿到时间戳,从而正确转换时间,而在i ...
- IDEA中写MyBatis的xml配置文件编译报错的坑
IDEA中写MyBatis的xml配置文件编译报错的坑 说明:用IDEA编译工具在项目中使用Mybatis框架,编写mybatis-config.xml和Mapper.xml配置文件时,编译项目出现错 ...
- vue 中使用 watch 出现了如下的报错
vue 中使用 watch 出现了如下的报错 报错: Method "watch" has type "object" in the component def ...
- SpringBoot中注入RedisTemplate实例异常解决(转)
最近,在项目开发过程中使用了RedisTemplate,进行单元测试时提示“Field redisTemplate in com.example.demo1.dao.RedisDao required ...
- sqli注入--利用information_schema配合双查询报错注入
目录 sqli-labs 5.6双查询报错注入通关 0x01 获取目标库名 0x02 获取库中表的数量 0x03 获取库中表名 0x04 获取目标表中的列数 0x05 获取目标表的列名 0x06 从列 ...
随机推荐
- CSplashScene类
#ifndef __TRANSITIONSCENE_H__ #define __TRANSITIONSCENE_H__ #include "GameFrameHead.h" cla ...
- quick-cocos2dx-2.2.4环境搭建
1.Quick-Coco2d-x介绍 Quick-Coco2d-x是Cocos2d-x在Lua上的增强和扩展版本,廖宇雷廖大觉得官方Cocos2d-x的Lua版本不是太好用,于是便在官方Lua版本的基 ...
- 基于js白色简洁样式计算器
今天给大家分享一款白色简洁样式计算器JS代码是一款精美简洁计算器JS代码插件网页特效,软件应用,后台应用JS计算器插件代码免费下载.适用浏览器:360.FireFox.Chrome.Safari.Op ...
- Unix系统编程()文件控制操作fcntl
fcntl系统调用对一个打开的文件描述符执行一系列的控制操作. int fcntl(int fd, int cmd, -) cmd参数所支持的操作范围很广 fcntl的第三个参数以省略号表示,意味着可 ...
- PS中进程状态
PROCESS STATE CODES Here are the different values that the s, stat and state output spec ...
- RabbitMQ之主题(Topic)【译】
在上一节中,我们改进了我们的日志系统,替换使用fanout exchange仅仅能广播消息,使得选择性的接收日志成为可能. 虽然使用direct exchange改进了我们的系统,但是它仍然由他的局限 ...
- Android基础总结(二)布局,存储
常见布局 相对布局 RelativeLayout 组件默认左对齐.顶部对齐 设置组件在指定组件的右边 android:layout_toRightOf="@id/tv1" 设置在指 ...
- 让 MySQL 支持 emoji 存储
要让 MySQL 开启 utf8mb4 支持,需要一些额外的设置. 1. 检查 MySQL Server 版本 utf8mb4 支持需要 MySQL Server v5.5.3+ 2. 设置表的 CH ...
- JavaScript实现网页安全登录(转)
现在很多商业网站的用户登录都是明码传输的,而一般用户又习惯于所有帐号使用相同的密码来保存,甚至很多人使用的密码和自己的银行帐号都一样哦!所 以嘛还是有一定的安全隐患的,YAHOO的免费邮箱登录使用了M ...
- JQuery操作表单相关使用总结
select下拉列表onChange事件之JQuery实现: JQuery: $(document).ready(function () { $("#selectMenu").bi ...