Configuration Ehcache和SLF4J错误

Configuration Ehcache和SLF4J错误,configuration,slf4j,ehcache,Configuration,Slf4j,Ehcache,我不熟悉Ehcache和Slf4j。我正在使用Ehcache-2.6.6 我用过 slf4j-api-1.6.1罐 slf4j-jdk14-1.6.1震击器 当我提取ehcache-2.6.6-distribution.tar时,这两个jar位于文件夹lib中 这是我的ehcache.xml <?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www

我不熟悉Ehcache和Slf4j。我正在使用Ehcache-2.6.6

我用过

slf4j-api-1.6.1罐

slf4j-jdk14-1.6.1震击器

当我提取ehcache-2.6.6-distribution.tar时,这两个jar位于文件夹lib中

这是我的ehcache.xml

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ehcache.xsd"
         updateCheck="true" monitoring="autodetect"
         dynamicConfig="true">


    <diskStore path="java.io.tmpdir"/>

    <defaultCache
            maxEntriesLocalHeap="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            diskSpoolBufferSizeMB="30"
            maxEntriesLocalDisk="10000000"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            statistics="false">
        <persistence strategy="localTempSwap"/>
    </defaultCache>

    <cache name="myCache1"
           maxEntriesLocalHeap="10000"
           maxEntriesLocalDisk="1000"
           eternal="false"
           diskSpoolBufferSizeMB="20"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           memoryStoreEvictionPolicy="LFU"
           transactionalMode="off">
        <persistence strategy="localTempSwap"/>
    </cache>
    
</ehcache>
虽然我得到了预期的输出,但开头说的是错误的:

我进去看看 错误,但我无法获取此错误

我在这里看到了类似的错误 但它是关于分布式缓存的。 对于我引用的代码

有什么帮助吗?为什么我一开始就出错了?

正如警告所说

To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
下面使用SingleToneCacheProvider行可以解决您的问题

<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</property>
SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
May 15, 2013 1:52:36 PM net.sf.ehcache.DiskStorePathManager resolveAndLockIfNeeded
WARNING: diskStorePath 'C:\Users\toshiba\AppData\Local\Temp' is already used by an existing CacheManager either in the same VM or in a different process.
The diskStore path for this CacheManager will be set to C:\Users\toshiba\AppData\Local\Temp\ehcache_auto_created3199473242323720768diskstore.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</property>