在春季启动中运行ehcache 2.9.0时获取异常

时间:2019-07-04 15:19:29

标签: java spring spring-boot ehcache-2

   <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNameSpaceSchemaLocation="ehcache.xsd"
     updateCheck="true"
     monitoring="autodetect"
     dynamicConfig="true">
    <diskStore path="java.io.tmpdir"/>
    <cache name="uniqueNumCacheable"
        maxEntriesLocalHeap="1000"
        maxEntriesLocalDisk="1000"
        eternal="false"
        diskSpoolBufferSizeMB="20"
        timeToIdleSeconds="300"
        timeToLiveSeconds="60"
        memoryStoreEvictionPolicy="LFU"
        transactionalMode="off">
    <persistence strategy="localTempSwap"/>
    </cache>
    <cache name="idCacheable"
        maxEntriesLocalHeap="1000"
        maxEntriesLocalDisk="1000"
        eternal="false"
        diskSpoolBufferSizeMB="20"
        timeToIdleSeconds="300"
        timeToLiveSeconds="60"
        memoryStoreEvictionPolicy="LFU"
        transactionalMode="off">
    <persistence strategy="localTempSwap"/>
    </cache>

    <cache name="uniqueNumAndIdCacheable"
        maxEntriesLocalHeap="1000"
        maxEntriesLocalDisk="1000"
        eternal="false"
        diskSpoolBufferSizeMB="20"
        timeToIdleSeconds="300"
        timeToLiveSeconds="60"
        memoryStoreEvictionPolicy="LFU"
        transactionalMode="off">
       <persistence strategy="localTempSwap"/>
     </cache>
   </ehcache>

   I am using spring boot with ehcache 2.9.0 version. When I am running 
   an 
    api with POST request, I am getting exception which is below ;

    2019-07-04 14:51:08.834 ERROR 21899 --- [43achaeble.data] 
     n.s.e.store.disk.DiskStorageFactory      : Disk Write of 
    9029HF013201 failed:
      java.io.NotSerializableException: 
     org.springframework.http.ResponseEntity
    at 
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) 
     ~[na:1.8.0_201]
    at 

java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)

〜[na:1.8.0_201] *         在java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)〜[na:1.8.0_201]         在net.sf.ehcache.Element.writeObject(Element.java:875)〜[ehcache-2.9.0.jar!/:2.9.0]         在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处〜[na:1.8.0_201]         在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_201]         在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_201]         在java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_201]         在java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1140)〜[na:1.8.0_201]         在java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)〜[na:1.8.0_201]         在java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)〜[na:1.8.0_201]         在java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)〜[na:1.8.0_201]         在java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)〜[na:1.8.0_201]         在net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:97)〜[ehcache-2.9.0.jar!/:2.9.0]         在net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:403)〜[ehcache-2.9.0.jar!/:2.9.0]         在net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:385)〜[ehcache-2.9.0.jar!/:2.9.0]         在net.sf.ehcache.store.disk.DiskStorageFactory $ DiskWriteTask.call(DiskStorageFactory.java:477)〜[ehcache-2.9.0.jar!/:2.9.0]         在net.sf.ehcache.store.disk.DiskStorageFactory $ PersistentDiskWriteTask.call(DiskStorageFactory.java:1071)[ehcache-2.9.0.jar!/:2.9.0]         位于net.sf.ehcache.store.disk.DiskStorageFactory $ PersistentDiskWriteTask.call(DiskStorageFactory.java:1055)[ehcache-2.9.0.jar!/:2.9.0]         在java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_201]         在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0_201]         在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[na:1.8.0_201]         在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[na:1.8.0_201]         在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)[na:1.8.0_201]         在java.lang.Thread.run(Thread.java:748)[na:1.8.0_201]      @PostMapping(“ / create”)     @CrossOrigin(origins = {“ http://localhost:8080”})     公共ResponseEntity userRegister(@RequestBody地图信息)引发异常{         返回新的SampleTest()。createOrbiteraMasterAccount(info);     }     我需要知道导致该异常的异常背后的原因      问题。     我在pom.xml中具有以下ehcache-                    net.sf.ehcache              ehcache              2.9.0              请帮助,我是ehcache的新手*

0 个答案:

没有答案