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. 每日英语:Air Pollution From Coal Use Cuts Lifespans in China, Study Shows

    Air pollution from coal combustion likely cut life expectancy in parts of China by more than five ye ...

  2. 【C语言】23-typedef

    一.typedef作用简介 * 我们可以使用typedef关键字为各种数据类型定义一个新名字(别名). 1 #include <stdio.h> 2 3 typedef int Integ ...

  3. Bootstrap学习笔记(6)--导航居中

    说明:没找到好办法 <div class="row"> <ul class="nav nav-pills col-md-offset-4"&g ...

  4. VBA 获得绝对地址控制焦点的设置

    先上代码,有时间再补上说明. Dim Mefoucs As String MsgBox "你选定的当前单元格是:" & Selection.Address Mefoucs ...

  5. springboot日志管理+集成log4j

    sprongboot使用的默认日志框架是Logback. 可以在application.properties配置简单日志属性,也可以单独配置logback.xml格式,还可以使用log4j来管理. 下 ...

  6. &quot;crsctl check crs&quot; command hangs at EVMD check

     Pre-11gR2: "crsctl check crs" command hangs at EVMD check (文档 ID 1578875.1) APPLIES TO: ...

  7. SQL Server 数据库同步,订阅、发布、复制、跨服务器

    随便说两句 折腾了一周,也算把数据库同步弄好了.首先局域网内搭建好,进行各种测试,弄的时候各种问题,弄好以后感觉还是挺简单的.本地测试好了,又在服务器进行测试,主要的难点就是跨网段同步,最后也解决了, ...

  8. Jquery动态添加 删除 操作实现

    这是gridView为空数据时显示的表头 下面直接填代码: function Add() { //动态添加行 $("#gridCustomerView").append(" ...

  9. JAVA面试-HIBERNATE与 MYBATIS的对比

    JAVA面试中问及HIBERNATE与 MYBATIS的对比,在这里做一下总结   我是一名java开发人员,hibernate以及mybatis都有过学习,在java面试中也被提及问道过,在项目实践 ...

  10. Java分为三个体系

    Java分为三个体系 JavaSE(Java2 Platform Standard Edition,java平台标准版), JavaEE(Java 2 Platform,Enterprise Edit ...