JFinal中使用Ehcache缓存是报错

justFinal 发布于 2015/06/19 13:22
阅读 445
收藏 0

@JFinal 请教个关于Ehcache的问题: 

我用Ehcache缓存一个map,这个map数据量较大,有几千个key,发现Ehcache报一下的错误:


请教一下是什么原因,我已经把配置文件中缓存的对象配置的很大了,diskPersistent也设置为True了。

[2015-06-19 12:30:48,144]-[ERROR]-[system.data]-[net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask#call.488]: Disk Write of sensitive_word failed: 

java.lang.StackOverflowError: null

at java.io.ObjectOutputStream$BlockDataOutputStream.writeBlockHeader(ObjectOutputStream.java:1890) ~[na:1.8.0_25]

at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1875) ~[na:1.8.0_25]

at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1786) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1108) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[na:1.8.0_25]

at java.util.HashMap.internalWriteEntries(HashMap.java:1776) ~[na:1.8.0_25]

at java.util.HashMap.writeObject(HashMap.java:1354) ~[na:1.8.0_25]

at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]

at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]

at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[na:1.8.0_25]

at java.util.HashMap.internalWriteEntries(HashMap.java:1777) ~[na:1.8.0_25]

at java.util.HashMap.writeObject(HashMap.java:1354) ~[na:1.8.0_25]

at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]

at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]

at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_25]

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[na:1.8.0_25]


加载中
0
JFinal
JFinal
检查一下是不是 map 中的对象有循环依赖, ehcache 在缓存时进入了死循环,造成了  java.lang.StackOverflowError 异常
JFinal
JFinal
回复 @justFinal : 可能是 ehcache 的 bug,升级到新版本的 ehcache 试试
j
justFinal
已经找到问题了,是因为map中存的数据问题,有null的值和一个超长的字符串,改掉就好了。 只是不知道为什么会出这个错误?@JFinal
返回顶部
顶部