在创建自定义模式时获取超类的序列化异常 - PersistentStateRef

时间:2017-07-25 06:48:22

标签: corda

Hello Corda团队/ Roger,

我已经基于Yo模式的示例实现了自定义模式,但是我得到消息缓冲区下溢的Kyro异常。

我在Schema类中添加了@cordaseriliazation注释以及扩展PersistentStateRef的实体类

在Plugin Registry类中,我已经覆盖了这个方法:

@Override
public boolean customizeSerialization(SerializationCustomization kryo) {
        kryo.addToWhitelist(PersistentStateRef.class);
      return true;
}

这是stacktrace:

[ERROR] 2017-07-21T14:52:51,407 [Thread-0 (ActiveMQ-client-global-threads)] core.client.run - AMQ214000: Failed to call onMessage
com.esotericsoftware.kryo.KryoException: Buffer underflow.
    at com.esotericsoftware.kryo.io.Input.require(Input.java:199) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.io.Input.readVarInt(Input.java:373) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:127) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.read(DefaultArraySerializers.java:389) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.read(DefaultArraySerializers.java:303) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at net.corda.core.serialization.KryoKt$deserialize$1$1.execute(Kryo.kt:109) ~[corda-core-0.13.0.jar:?]
    at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:61) ~[kryo-4.0.0.jar:?]
    at net.corda.core.serialization.KryoKt.deserialize(Kryo.kt:109) ~[corda-core-0.13.0.jar:?]
    at net.corda.nodeapi.RPCApi$ClientToServer$Companion.fromClientMessage(RPCApi.kt:124) ~[corda-node-api-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer.clientArtemisMessageHandler(RPCServer.kt:264) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer.access$clientArtemisMessageHandler(RPCServer.kt:76) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:190) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:76) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServerKt$sam$MessageHandler$086628f7.onMessage(RPCServer.kt) ~[corda-node-0.13.0.jar:?]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:997) ~[artemis-core-client-2.1.0.jar:2.1.0]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) ~[artemis-core-client-2.1.0.jar:2.1.0]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1120) [artemis-core-client-2.1.0.jar:2.1.0]
    at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:101) [artemis-commons-2.1.0.jar:2.1.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]

1 个答案:

答案 0 :(得分:0)

这肯定似乎是Corda流处理中的一个问题,因为它存在AMQP错误。

我将再次查看在最新版本的corda中运行使用此模式的流时发生的情况,并查看它们是否存在类似的问题。

如果您继续面对它,那可能是一个Corda错误,而不是您,您可以在以下位置向Corda报告问题:https://github.com/corda/corda/issues