2010-08-19 5 views
0

openjpa로 ehcache를 구성하려고합니다.EhCache로 OpenJPA 1.3.1 구성 : plugin/alias를 찾을 수 없음

여기
 <property name="openjpa.QueryCache" value="ehcache" /> 
     <property name="openjpa.DataCacheManager" value="ehcache" /> 

내 ehcache.xml입니다 :

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect" dynamicConfig="true"> 

    <!-- --> 
    <cache name="openjpa" maxElementsInMemory="10000" 
    maxElementsOnDisk="1000" eternal="false" overflowToDisk="true" 
    diskSpoolBufferSizeMB="20" timeToIdleSeconds="300" 
    timeToLiveSeconds="600" memoryStoreEvictionPolicy="LFU" 
    transactionalMode="on" /> 
</ehcache> 

그리고 여기에 종속 플러그인 내 pom.xml 파일의

org.apache.openjpa.lib.util.ParseException: 
Instantiation of plugin "DataCacheManager" with value "ehcache" caused an error 
"java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: ehcache". 
The alias or class name may have been misspelled, or the class may not have be available in the class path. 
Valid aliases for this plugin are: [default] 

여기 내 발췌의 persistence.xml에서이다 : 나는 다음과 같은 오류가 발생합니다 : net.sf.ehcache ehcache-openjpa 0.2.0

openjpa + ehcache를 구성하는 다른 방법이 있습니까?

답변

0

예 그래야합니다. ehcache-openjpa jar 파일이 클래스 경로에 있는지 확인하십시오. 컨테이너 환경 (예 : WAS)에서 실행 중이면 약간 더 복잡하다는 것을 알고 있습니다.

[업데이트] 나는이 한 지점에서 근무했고, 나는 도서관이 작업을 얻기 위해 공유 된 재미있는 일을했다,하지만 난 내 노트 중 하나를 찾을 수 없습니다 알고

. 나는이 문제가 OpenJPA가 시작시에 Ehcache를 감지하지 못한다는 것을 철저히 상기하며, 우리는 'ehcache'별칭을 등록하지 않았다.

다음 속성는 OpenJPA를 구성하십시오 :

<property name="openjpa.QueryCache" value="net.sf.ehcache.openjpa.datacache.EhCacheQueryCache"/> <property name="openjpa.DataCacheManager" value="net.sf.ehcache.openjpa.datacache.EhCacheDataCacheManager"/> <property name="openjpa.DataCache" value="net.sf.ehcache.openjpa.datacache.EhCacheDataCache"/> <property name="openjpa.RemoteCommitProvider" value="net.sf.ehcache.openjpa.datacache.NoOpRemoteCommitProvider"/>

[/ 업데이트]

+0

당신이 컨테이너 environemnt에 대한 추가 정보를 제공 할 수 있습니까? 나는 WAS를 운영하고있다. –