• 解决ehcache的UpdateChecker问题


    问题描述

    项目中用了ssh框架,每次启动tomcat的时候都特别慢,会在这样一句话下面停留很久

    [2016-01-08 23:55:51,517 INFO UpdateChecker.java:doCheck:98] ---- New update(s) found: 2.6.5 [http://www.terracotta.org/confluence/display/release/Release+Notes+Ehcache+Core+2.6]. Please check http://ehcache.org for the latest version.
    

    原来是hibernate用了ehcache,ehcache会默认去自己网站查询更新。

    解决思路

    我去bing中搜索解决办法,搜到的大部分都是如下内容:

    解决问题,修改配置,关闭更新检测:
    打开 ehcache.xml 将第一行 <ehcache> 的属性 updateCheck 改为false,如下:
    <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false">
    

    可是我根本就没有用ehcache啊,根本找不到这个配置文件。自己尝试着去加这个配置文件,配置了好一会,都没有成功。

    最终解决办法

    看来思路是对的,但是要绕弯。我又仔细看了一下log输出,看到这样一句话:

    No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/C:/SourceCode/WebRoot/WEB-INF/lib/spring/ehcache-core-2.5.2.jar!/ehcache-failsafe.xml
    

    也就是说,这个配置文件打在了jar包里面。这就好办了:

    1. 解压缩这个jar文件
    2. 修改文件ehcache-failsafe.xml,如上面所说
    3. 把目录打成zip文件,ehcache-core-2.5.2.zip
    4. 把上面的zip文件重命名为ehcache-core-2.5.2.jar,覆盖原文件,搞定。
    
  • 相关阅读:
    python之处理excel表格
    Django下JWT的使用
    Flask的上下文管理
    模块循环引用
    博客声明及意义
    IPTABLES--iptables
    挂载U盘
    tar压缩解压
    iconv字符编码转换
    VirtualBox设置共享文件夹
  • 原文地址:https://www.cnblogs.com/wardensky/p/5115267.html
Copyright © 2020-2023  润新知