내 JCache 구현으로 Ecache를 사용할 수 있도록 다음 jcache-ehcache 라이브러리를 래퍼로 사용하려고합니다.Ehcache as JCache Implementation in Spring
이 내 받는다는 의존성은 다음과 같습니다
내 Spring 설정 파일에서<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.1.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-jcache</artifactId>
<version>1.4.0-beta1</version>
</dependency>
, 나는 다음과 같은 콩이 :
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="shared" value="true"/>
</bean>
<bean id="userCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheName" value="userCache"/>
<property name="cacheManager" ref="cacheManager"/>
<property name="diskPersistent" value="false"/>
</bean>
<bean id="jcacheUserCache" class="net.sf.ehcache.jcache.JCache">
<constructor-arg index="0" ref="userCache"/>
</bean>
그리고 내 Ehcache.xml (클래스 패스 루트에) 파일이 userCache을 포함을 영역 정의 :
<cache name="userCache" maxElementsInMemory="10000"
maxElementsOnDisk="0" eternal="false" overflowToDisk="false"
diskSpoolBufferSizeMB="20" timeToIdleSeconds="0"
timeToLiveSeconds="0" memoryStoreEvictionPolicy="LFU"
statistics = "true">
</cache>
초기화시 다음 오류가 발생합니다.
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jcacheUserCache' defined in class path resource [application-context.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [net.sf.ehcache.jcache.JCacheManager]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
사람이 올바르게 jCacheUserCache
빈을 초기화하는 방법에 어떤 도움을 제공 할 수 있습니까?
감사
흠 - 나는이 패키지 이름 API- 잘못된보고 있었다 매우 비슷한 있습니다! – totalcruise