Corda和Corda Enterprise节点之间的交互过程中的序列化方案错误

时间:2018-11-01 15:20:39

标签: corda

我有一个包含两个节点的网络:

  • NodeA运行Corda Enterprise 3
  • NodeB运行Corda 3(开源)

NodeA使用Corda Finance CorDapp将现金转账到NodeB时,出现Serialization scheme not supported.形式的异常。

如果Finance CorDapp是针对Corda Enterprise 3.2编译的,则会得到以下堆栈跟踪:

  

java.lang.UnsupportedOperationException:序列化方案   ([636F7264610000],RPCClient)不受支持。在   net.corda.serialization.internal.SerializationFactoryImpl $ schemeFor $ 1.apply(SerializationScheme.kt:128)     在   net.corda.serialization.internal.SerializationFactoryImpl $ schemeFor $ 1.apply(SerializationScheme.kt:103)     在   java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)     在   net.corda.serialization.internal.SerializationFactoryImpl.schemeFor(SerializationScheme.kt:124)     在   net.corda.serialization.internal.SerializationFactoryImpl.access $ schemeFor(SerializationScheme.kt:103)     在   net.corda.serialization.internal.SerializationFactoryImpl $ deserialize $ 1 $ 1.invoke(SerializationScheme.kt:134)     在   net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:71)     在   net.corda.serialization.internal.SerializationFactoryImpl $ deserialize $ 1.invoke(SerializationScheme.kt:134)     在   net.corda.serialization.internal.SerializationFactoryImpl $ deserialize $ 1.invoke(SerializationScheme.kt:103)     在   net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:85)     在   net.corda.serialization.internal.SerializationFactoryImpl.deserialize(SerializationScheme.kt:134)     在   net.corda.nodeapi.RPCApi $ ServerToClient $ Companion.fromClientMessage(RPCApi.kt:373)     在   net.corda.client.rpc.internal.RPCClientProxyHandler.artemisMessageHandler(RPCClientProxyHandler.kt:301)     在   net.corda.client.rpc.internal.RPCClientProxyHandler.access $ artemisMessageHandler(RPCClientProxyHandler.kt:75)     在   net.corda.client.rpc.internal.RPCClientProxyHandler $ initSessions $ 1.invoke(RPCClientProxyHandler.kt:509)     在   net.corda.client.rpc.internal.RPCClientProxyHandler $ initSessions $ 1.invoke(RPCClientProxyHandler.kt:75)     在   net.corda.client.rpc.internal.RPCClientProxyHandlerKt $ sam $ org_apache_activemq_artemis_api_core_client_MessageHandler $ 0.onMessage(RPCClientProxyHandler.kt)     在   org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1002)     在   org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access $ 400(ClientConsumerImpl.java:50)     在   org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl $ Runner.run(ClientConsumerImpl.java:1125)     在   org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42)     在   org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31)     在   org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:66)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)     在   org.apache.activemq.artemis.utils.ActiveMQThreadFactory $ 1.run(ActiveMQThreadFactory.java:118)     在✽。节点PartyB保管库包含100的总现金   GBP(兼容性/资源/功能/互操作性。功能:15)

并且如果Finance CorDapp是针对Corda(开源)3.3编译的,我将获得以下堆栈跟踪:

  

[WARN] 2018-10-02T11:06:54,096Z [线程1   (ActiveMQ-client-global-threads)]   messages.RPCServer.clientArtemisMessageHandler-入站RPC失败   {actor_id = corda,actor_owningIdentity = O = PartyB,L =伦敦,C = GB,   actor_store_id = NODE_CONFIG,   invocation_id = ae1b8b8d-682a-4181-acba-45c061188531,   invocation_timestamp = 2018-10-02T11:06:54.094Z,   session_id = 85154c4f-cdfa-4f76-b888-51d8f862c3b1,   session_timestamp = 2018-10-02T11:06:54.050Z}   java.lang.UnsupportedOperationException:序列化方案不正确   支持的。           在net.corda.nodeapi.internal.serialization.NotSupportedSerializationScheme.doThrow(SerializationScheme.kt:19)   〜[corda-node-api-3.2-corda.jar :?]           在net.corda.nodeapi.internal.serialization.NotSupportedSerializationScheme.deserialize(SerializationScheme.kt:23)   〜[corda-node-api-3.2-corda.jar :?]           在net.corda.nodeapi.internal.serialization.SerializationFactoryImpl $ deserialize $ 1 $ 1.invoke(SerializationScheme.kt:111)   〜[corda-node-api-3.2-corda.jar :?]           在net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66)   〜[corda-core-3.2-corda.jar :?]           在net.corda.nodeapi.internal.serialization.SerializationFactoryImpl $ deserialize $ 1.invoke(SerializationScheme.kt:111)   〜[corda-node-api-3.2-corda.jar :?]           在net.corda.nodeapi.internal.serialization.SerializationFactoryImpl $ deserialize $ 1.invoke(SerializationScheme.kt:86)   〜[corda-node-api-3.2-corda.jar :?]           在net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80)   〜[corda-core-3.2-corda.jar :?]           在net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111)   〜[corda-node-api-3.2-corda.jar :?]           在net.corda.node.services.messaging.RPCServer.clientArtemisMessageHandler(RPCServer.kt:571)   [corda-node-3.2-corda.jar :?]           在net.corda.node.services.messaging.RPCServer.access $ clientArtemisMessageHandler(RPCServer.kt:79)   [corda-node-3.2-corda.jar :?]           在net.corda.node.services.messaging.RPCServer $ createRpcConsumer $ 1.invoke(RPCServer.kt:196)   [corda-node-3.2-corda.jar :?]           在net.corda.node.services.messaging.RPCServer $ createRpcConsumer $ 1.invoke(RPCServer.kt:79)   [corda-node-3.2-corda.jar :?]           在net.corda.node.services.messaging.RPCServerKt $ sam $ MessageHandler $ 5b9bfc45.onMessage(RPCServer.kt)   [corda-node-3.2-corda.jar :?]           在org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:997)   [artemis-core-client-2.2.0.jar:2.2.0]           在org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access $ 400(ClientConsumerImpl.java:49)   [artemis-core-client-2.2.0.jar:2.2.0]           在org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl $ Runner.run(ClientConsumerImpl.java:1120)   [artemis-core-client-2.2.0.jar:2.2.0]           在org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42)   [artemis-commons-2.2.0.jar:2.2.0]           在org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31)   [artemis-commons-2.2.0.jar:2.2.0]           在org.apache.activemq.artemis.utils.actors.ProcessorBase $ ExecutorTask.run(ProcessorBase.java:53)   [artemis-commons-2.2.0.jar:2.2.0]           在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)   [?:1.8.0_171]           在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)   [?:1.8.0_171]           在java.lang.Thread.run(Thread.java:748)[?:1.8.0_171] [WARN] 2018-10-02T11:06:54,162Z [Thread-0(ActiveMQ-client-global-threads)]   messages.RPCServer.bindingRemovalArtemisMessageHandler-检测到的RPC   客户端在地址rpc.client.corda.4301680594427178011上断开连接,   安排收割{}

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

这是Corda 3中的一个错误,其中:

  • 针对Corda Enterprise 3编译的CorDapp无法在Corda 3节点上运行
  • 针对Corda 3编译的CorDapp无法在Corda Enterprise 3节点上运行

这是由于Corda 3使用Kryo进行RPC,而Corda Enterprise 3使用AMQP进行了RPC。

有两种解决方法:

  • 两次编译CorDapp-一次用于Corda 3节点,一次一次用于Corda Enterprise 3节点
  • 升级到Corda 4