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 时候 存在报错的更多相关文章

  1. Springboot解决资源文件404,503等特殊报错,无法访问

    Springboot解决资源文件404,503等特殊报错 原文链接:https://www.cnblogs.com/blog5277/p/9324609.html 原文作者:博客园--曲高终和寡 ** ...

  2. springboot 2.1.6.RELEASE pom 第一行报错

    eclipse创建springboot 2.1.6.RELEASE  pom第一行报错 在pom.xml 文件的properties中加入maven jar插件的版本号 <maven-jar-p ...

  3. springboot x.x.x RELEASE pom 第一行报错解决办法

    springboot x.x.x RELEASE pom 第一行报错解决办法 在pom.xml 文件的properties中加入maven jar插件的版本号 <properties> & ...

  4. php中读取中文文件夹及文件报错

    php读取时出现中文乱码 一般php输出中出现中文乱码我们可用 header ('content:text/html;charset="utf-8"'); php中读取中文文件夹及 ...

  5. javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决

    javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决 在做移动端时间转化为时间戳时,遇到了一个问题,安卓手机上访问时,能拿到时间戳,从而正确转换时间,而在i ...

  6. IDEA中写MyBatis的xml配置文件编译报错的坑

    IDEA中写MyBatis的xml配置文件编译报错的坑 说明:用IDEA编译工具在项目中使用Mybatis框架,编写mybatis-config.xml和Mapper.xml配置文件时,编译项目出现错 ...

  7. vue 中使用 watch 出现了如下的报错

    vue 中使用 watch 出现了如下的报错 报错: Method "watch" has type "object" in the component def ...

  8. SpringBoot中注入RedisTemplate实例异常解决(转)

    最近,在项目开发过程中使用了RedisTemplate,进行单元测试时提示“Field redisTemplate in com.example.demo1.dao.RedisDao required ...

  9. sqli注入--利用information_schema配合双查询报错注入

    目录 sqli-labs 5.6双查询报错注入通关 0x01 获取目标库名 0x02 获取库中表的数量 0x03 获取库中表名 0x04 获取目标表中的列数 0x05 获取目标表的列名 0x06 从列 ...

随机推荐

  1. Atitit. Java script 多重多重catch语句的实现and Javascript js 异常机制

    Atitit. Java script 多重多重catch语句的实现and Javascript js 异常机制 1. 语法错误(ERROR)和运行期错误(Exception) 1 2. 错误类型判断 ...

  2. Delphi 全局画点TCanvas.Pixels[X,Y]

    procedure TForm1.btnChangePixelClick(Sender: TObject); var baseX : integer ; baseY : integer ; i,j : ...

  3. 安装vim 出现 terminal libary 错误,解决方法

    通过源码安装vim时,提示缺少terminal libary 而在安装ncurses以后,此问题照样出现. 经过查找资料发现.运行例如以下命令就能够正常安装vim <pre name=" ...

  4. CWidgetMgr---H

    /************************************************************************/ //管理部件 //部件自动根据Z顺序调整消息的优先 ...

  5. Tomcat7中开启gzip压缩功能的配置方法

    使用gzip压缩可以减少数据传输大小,加快网页加载速度.很多大站都开启了gzip压缩,不过也有很多网站并没有开启gzip压缩,上次看了一篇文章说开启gzip压缩后对搜索引擎不友好,但从带宽和流量的角度 ...

  6. 每日英语:Is Bedtime Snacking Bad?

    It's a familiar scenario in many households: Hours after dinner, the stomach growls and the refriger ...

  7. Pgsql特殊排序

    对字段值为A,B,C,D的时候进行特殊排序. CASE WHEN aa = 'H' THEN ' WHENaa = 'O' THEN ' ELSE aa END 对数字进行排序,升序,0排到最后面 C ...

  8. groupBox和panel

    private void Form1_Load(object sender, EventArgs e) { groupBox1.Text = "信息表"; panel1.Borde ...

  9. HIbernate與不支持boolean的數據庫之間的映射

    http://soft-development.iteye.com/blog/1225274 ————————————————————————————————————————————————————— ...

  10. JavaScript中的两个“0”(翻译)

    本文翻译自JavaScript’s two zeros JavaScript has two zeros: −0 and +0. This post explains why that is and ...