title: ehcache memory only cache attempting to store to disk
body: <p>I have the following in my ehcache.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false" &gt;
  
      &lt;defaultCache
          maxElementsInMemory="500"
          eternal="false"
          overflowToDisk="false"
          overflowToOffHeap="false"
          memoryStoreEvictionPolicy="LRU" &gt;
          &lt;persistence strategy="none" /&gt;
      &lt;/defaultCache&gt;
  
      &lt;cache name="leadSourceCollectionsCache" 
          maxElementsInMemory="500" 
          eternal="false"
          overflowToDisk="false"
          overflowToOffHeap="false"
          memoryStoreEvictionPolicy="LRU" &gt;
  
          &lt;persistence strategy="none" /&gt;
      &lt;/cache&gt;
  
  &lt;/ehcache&gt;
  </code></pre>
  
  <p>When I start my server I see the following ehcache related debug output</p>
  
  <pre><code>07.08.2013 15:36:10 DEBUG-ConfigurationFactory: [Configuring ehcache from InputStream]
  07.08.2013 15:36:10 DEBUG-BeanHandler: [Ignoring ehcache attribute xmlns:xsi]
  07.08.2013 15:36:10 DEBUG-BeanHandler: [Ignoring ehcache attribute xsi:noNamespaceSchemaLocation]
  07.08.2013 15:36:10 DEBUG-PropertyUtil: [propertiesString is null.]
  07.08.2013 15:36:10 DEBUG-ConfigurationHelper: [No CacheManagerEventListenerFactory class specified. Skipping...]
  07.08.2013 15:36:10 DEBUG-Cache: [No BootstrapCacheLoaderFactory class specified. Skipping...]
  07.08.2013 15:36:10 DEBUG-Cache: [CacheWriter factory not configured. Skipping...]
  07.08.2013 15:36:10 DEBUG-ConfigurationHelper: [No CacheExceptionHandlerFactory class specified. Skipping...]
  07.08.2013 15:36:10 DEBUG-Cache: [No BootstrapCacheLoaderFactory class specified. Skipping...]
  07.08.2013 15:36:10 DEBUG-Cache: [CacheWriter factory not configured. Skipping...]
  07.08.2013 15:36:10 DEBUG-ConfigurationHelper: [No CacheExceptionHandlerFactory class specified. Skipping...]
  07.08.2013 15:36:10 DEBUG-MemoryStore: [Initialized net.sf.ehcache.store.NotifyingMemoryStore for leadSourceCollectionsCache]
  07.08.2013 15:36:10 DEBUG-Cache: [Initialised cache: leadSourceCollectionsCache]
  07.08.2013 15:36:10 DEBUG-ConfigurationHelper: [CacheDecoratorFactory not configured. Skipping for 'leadSourceCollectionsCache'.]
  07.08.2013 15:36:10 DEBUG-ConfigurationHelper: [CacheDecoratorFactory not configured for defaultCache. Skipping for 'leadSourceCollectionsCache'.]
  07.08.2013 15:36:10 DEBUG-Cache: [No BootstrapCacheLoaderFactory class specified. Skipping...]
  07.08.2013 15:36:10 DEBUG-Cache: [CacheWriter factory not configured. Skipping...]
  07.08.2013 15:36:10 DEBUG-MemoryStore: [Initialized net.sf.ehcache.store.MemoryStore for leadSourceCollectionCache]
  07.08.2013 15:36:10 DEBUG-DiskStorePathManager: [Using diskstore path /tmp]
  07.08.2013 15:36:10 DEBUG-DiskStorePathManager: [Holding exclusive lock on /tmp/.ehcache-diskstore.lock]
  07.08.2013 15:36:10 DEBUG-DiskStorageFactory: [Failed to delete file lead%0053ource%0043ollection%0043ache.index]
  07.08.2013 15:36:10 DEBUG-DiskStorageFactory: [Matching data file missing (or empty) for index file. Deleting index file /tmp/lead%0053ource%0043ollection%0043ache.index]
  07.08.2013 15:36:10 DEBUG-DiskStorageFactory: [Failed to delete file lead%0053ource%0043ollection%0043ache.index]
  07.08.2013 15:36:10 DEBUG-Cache: [Initialised cache: leadSourceCollectionCache]
  </code></pre>
  
  <p>So it looks like it is creating the leadSourceCollectionCache as a memory store cache, which is what I want. However, when I call leadSourceCollectionCache.put I get the following</p>
  
  <p>07.08.2013 15:37:46 DEBUG-Segment: [put added 0 on heap]
  07.08.2013 15:37:46 ERROR-DiskStorageFactory: [Disk Write of 1-2 failed: ]</p>
  
  <pre><code>java.io.NotSerializableException: intouch.connector.business.LeadSourceCollection
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1181)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1541)
      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:439)
      at net.sf.ehcache.Element.writeObject(Element.java:835)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
      at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:97)
      at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:405)
      at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:384)
      at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:485)
      at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1088)
      at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1072)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>I cannot for the life of me figure out why this is happening. I do not want my cache to touch the disk in any way. I also don't know why it is attempt to write things to /tmp when persistence is set to none. </p>