• ehcache版本冲突


    以ehchache-core2.5为分水岭 缓存版本问题 版本不一样 配置不一样  ehcache-core-2.4.3.jar 与 ehcache-core-2.6.6

    Caused by: net.sf.ehcache.CacheException: Error configuring from input stream. Initial  cause was null:9: Element <defaultCache> does not allow attribute "maxEntriesLocalHeap".

    at    net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:152)

    at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:99)

    ... 30 more

    Got the same problem with Spring, maxEntriesLocalHeap and maxEntriesLocalDisk threw the same exception. What seemed to work for me was using maxElementsInMemory and maxElementsOnDisk instead. Found them from javadoc.

    Now, based on them being deprecated, I assume there was an older version of EHCache going on with my conf, as well as yours.

    Based on this table, maxEntriesLocalHeap came on EHCache 2.5. Before that it was maxElementsInMemory. When I had trouble, I had used ehcache-spring-annotations, and as of this writing it is on version 1.2.0, coming with ehcache 2.4.5 - thus not supporting these properties.

    After going for pure Spring config and explicit dependency to EHCache 2.5, problem went away and I was able to use the properties I originally intended to.

    单例问题

  • 相关阅读:
    C#学习笔记
    Visual Studio 快捷键
    java 8 中lambda表达式学习
    Spfa算法
    dijkstra算法
    topSort
    并查集--学习详解
    trie树--详解
    POJ1988 并查集的使用
    Mybatis的一级缓存和二级缓存
  • 原文地址:https://www.cnblogs.com/zhangcybb/p/3843452.html
Copyright © 2020-2023  润新知