WebLogic 9.1 인스턴스에서 실행중인 웹 응용 프로그램에서 EHCache 1.5.0을 사용하고 있습니다. 가끔씩 캐시에서 요소를 가져 오는 동안 또는 항목이 캐시에 있는지 확인하는 동안 다음 오류가 발생합니다. 이 문제를 본 다른 사람이 있습니까? 이 문제를 해결하는 방법에 대한 제안은 훌륭합니다. 이 문제가 발생캐시 키를 조회 할 때 EHCache 오류가 발생했습니다.
코드 :
getMyCache().isKeyInCache(cacheKey)
으로 Ehcache 구성 :
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation"><value>classpath:ehcache.xml</value></property>
</bean>
: 여기 CacheManager의 인스턴스를 얻기 위해 스프링을 사용하고
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="true"
내 빈 정의입니다
오류는 다음과 같습니다 :
java.lang.NullPointerException
at net.sf.ehcache.Cache.isElementInMemory(Cache.java:1962)
at net.sf.ehcache.Cache.isKeyInCache(Cache.java:2075)
at com.test.services.impl.ContentServicesImpl.getContentItemFromCache(ContentServicesImpl.java:260) ......
캐시에서 키를 조회 할 때 NullPointerException의 원인을 나타내는 로그에는 다른 것이 없습니다.
모든 포인터,이 문제를 해결하는 방법에 대한 제안은 크게 감사하겠습니다. 이것은 일관되게 발생하지 않으며, 한 환경에서 무작위로 발생하는 것 같습니다.