title: EHCache error on looking up by cache key
body: <p>I am using EHCache 1.5.0 on a webapp running on a WebLogic 9.1 instance. Once in a while I run into the following error while getting an element from cache or while checking if an item exists in cache. Has anyone else seen this issue? Any suggestions on how to fix this would be great.</p>
  
  <p>Code that causes this issue:</p>
  
  <pre><code>getMyCache().isKeyInCache(cacheKey)
  </code></pre>
  
  <p>ehcache configuration:</p>
  
  <pre><code>maxElementsInMemory="10000"
  eternal="false"
  timeToIdleSeconds="120"
  timeToLiveSeconds="120"
  overflowToDisk="true"
  diskPersistent="true"
  </code></pre>
  
  <p>I am using Spring to get an instance of CacheManager and here is my bean definition:</p>
  
  <pre><code>   &lt;bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"&gt;
          &lt;property name="configLocation"&gt;&lt;value&gt;classpath:ehcache.xml&lt;/value&gt;&lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>The error is as follows:</p>
  
  <pre><code>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) ......
  </code></pre>
  
  <p>There is nothing else in the log indicating the cause for the NullPointerException on looking up a key in cache. </p>
  
  <p>Any pointers, suggestions on how to fix this will be greatly appreciated. This does not happen consistently, seems to happen randomly in one environment.</p>