当前位置: 代码迷 >> 综合 >> idea启动项目报错:xxx/WEB-INF/lib/ehcache-core-2.4.3.jar
  详细解决方案

idea启动项目报错:xxx/WEB-INF/lib/ehcache-core-2.4.3.jar

热度:59   发布时间:2023-12-26 04:56:22.0

idea启动项目报错:

No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath:jar:file:/D:/Codes/classes/artifacts/Codes_war_exploded/WEB-INF/lib/ehcache-core-2.4.3.jar!/ehcache-failsafe.xml

解决方法:在resources下面添加ehcache.xml文件

ehcache.xml内容:

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="https://www.ehcache.org/ehcache.xsd"><!-- 磁盘缓存位置 --><diskStore path="java.io.tmpdir"/><!-- 默认缓存 --><defaultCachemaxElementsInMemory="10000"eternal="false"timeToIdleSeconds="120"timeToLiveSeconds="120"maxElementsOnDisk="10000000"diskExpiryThreadIntervalSeconds="120"memoryStoreEvictionPolicy="LRU"><persistence strategy="localTempSwap"/></defaultCache>
</ehcache>

然后在application.yml下添加:

spring:cache:ehcache:config: classpath:ehcache.xml

pom.xml里面添加:

<dependency><groupId>org.ehcache</groupId><artifactId>ehcache</artifactId><version>3.7.1</version>
</dependency>

重启,解决啦!!!!

 

 

 
 

 

 

  相关解决方案