@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]
检查一下是不是map中的对象有循环依赖,ehcache在缓存时进入了死循环,造成了 java.lang.StackOverflowError异常回复<aclass='referer'target='_blank'>@justFinal:可能是ehcache的bug,升级到新版本的ehcache试试已经找到问题了,是因为map中存的数据问题,有null的值和一个超长的字符串,改掉就好了。只是不知道为什么会出这个错误?<aclass='referer'target='_blank'>@JFinal
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。