java – Kryo crash EnvironmentFailureException

前端之家收集整理的这篇文章主要介绍了java – Kryo crash EnvironmentFailureException前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图序列化一些自定义类的对象,我得到以下异常:
com.esotericsoftware.kryo.KryoException: com.sleepycat.je.EnvironmentFailureException: (JE 5.0.73) IdentityHashMap.entrySet() should not be used. See [#18167]. UNEXPECTED_STATE: Unexpected internal state,may have side effects.
Serialization trace:
highestFlushLevels (com.sleepycat.je.recovery.DirtyINMap)
checkpointDirtyMap (com.sleepycat.je.recovery.Checkpointer)
checkpointer (com.sleepycat.je.dbi.EnvironmentImpl)
envImpl (com.sleepycat.je.dbi.MemoryBudget)
budget (com.sleepycat.je.cleaner.DbFileSummaryMap)
dbFileSummaries (com.sleepycat.je.dbi.DatabaseImpl)
databaseImpl (com.sleepycat.je.Database)
db (com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEKeyValueStore)
store (com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreAdapter)
store (com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.NoKCVSCache)
edgeStore (com.thinkaurelius.titan.diskstorage.Backend)
backend (com.thinkaurelius.titan.graphdb.database.StandardTitanGraph)
graph (com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx)
tx (com.thinkaurelius.titan.graphdb.types.vertices.PropertyKeyVertex)
key (com.thinkaurelius.titan.graphdb.relations.SimpleTitanProperty)
properties (main.java.com.bag.util.storage.RelationshipStorage)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:101)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:651)
    at com.esotericsoftware.kryo.serializers.MapSerializer.write(MapSerializer.java:113)
    at com.esotericsoftware.kryo.serializers.MapSerializer.write(MapSerializer.java:39)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:505)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:651)
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:100)
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:40)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:651)
    at main.java.com.bag.server.TestServer.handleRelationshipRead(TestServer.java:299)
    at main.java.com.bag.server.TestServer.appExecuteUnordered(TestServer.java:219)
    at bftsmart.tom.server.defaultservices.DefaultRecoverable.executeUnordered(DefaultRecoverable.java:417)
    at bftsmart.tom.ServiceReplica.receiveReadonlyMessage(ServiceReplica.java:214)
    at bftsmart.tom.core.DeliveryThread.deliverUnordered(DeliveryThread.java:289)
    at bftsmart.tom.core.TOMLayer.requestReceived(TOMLayer.java:290)
    at bftsmart.communication.client.netty.NettyClientServerCommunicationSystemServerSide.channelRead0(NettyClientServerCommunicationSystemServerSide.java:184)
    at bftsmart.communication.client.netty.NettyClientServerCommunicationSystemServerSide.channelRead0(NettyClientServerCommunicationSystemServerSide.java:61)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:277)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:264)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:962)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.sleepycat.je.EnvironmentFailureException: (JE 5.0.73) IdentityHashMap.entrySet() should not be used. See [#18167]. UNEXPECTED_STATE: Unexpected internal state,may have side effects.
    at com.sleepycat.je.EnvironmentFailureException.unexpectedState(EnvironmentFailureException.java:376)
    at com.sleepycat.je.utilint.IdentityHashMap.entrySet(IdentityHashMap.java:31)
    at com.esotericsoftware.kryo.serializers.MapSerializer.write(MapSerializer.java:98)
    at com.esotericsoftware.kryo.serializers.MapSerializer.write(MapSerializer.java:39)
    at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)
    at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)
    ... 77 more

我有一个ArrayList:

ArrayList<RelationshipStorage> relationshipStorage = new ArrayList<>();

存储是可序列化的,其中的所有内容也是如此.

但是我仍然有这个错误,我不知道为什么.
财产地图中只有一个键和值.
键是一个字符串,该值是一个长字符串(整个对象的散列).

解决方法

由于我的存储对象接受任何类型的地图,我没有注意到其中一个数据库返回了一个IdentityHashMap实例. 删除和执行正常的HashMap的使用解决了这个问题.
原文链接:https://www.f2er.com/java/122992.html

猜你在找的Java相关文章