Corda Node

时间:2018-09-05 06:14:59

标签: corda

场景:

  1. 我正在Linux实例上运行irs-demo应用程序
  2. NodeExplorer已安装在Windows实例上
  3. 我尝试连接到irs-demo的BankA节点,以使用NodeExplorer的帮助查看节点库和事务 以下命令:

    java -jar corda-tools-explorer-3.2-corda.jar

  4. 以下是我用来登录NodeExplorer的PartyA凭据

      Corda Node: <IP_address_of_Linux_instance>
      Port: <RPC_port_number>
      Username: <RPC_user>
      Password: <RPC_password>
    

观察

  1. 当PartyA不执行任何交易时,我可以使用大约凭据成功登录到NodeExplorer并连接到PartyA
  2. 当我使用Web浏览器为PartyA进行少量交易,然后尝试使用相同的凭据登录到NodeExplorer时,抛出以下异常:

    [INFO ] 05:02:07,923 [JavaFX Application Thread] (InternalUtils.kt:208) internal.RPCClient.logElapsedTime - Startup took 1084 msec {}  
    00:02  WARN: [kryo] Unable to load class net.corda.irs.contract.InterestRateSwap$State with kryo's ClassLoader. Retrying with current..
    [ERROR] 05:02:09,791 [Thread-0 (ActiveMQ-client-global-threads)] (ClientConsumerImpl.java:1122) core.client.run - AMQ214000: Failed to call onMessage {}
    com.esotericsoftware.kryo.KryoException: Unable to find class: net.corda.irs.contract.InterestRateSwap$State
    Serialization trace:
    data (net.corda.core.contracts.TransactionState)
    state (net.corda.core.contracts.StateAndRef)
    states (net.corda.core.node.services.Vault$Page)
    snapshot (net.corda.core.messaging.DataFeed)
    value (net.corda.core.utilities.Try$Success)
    at     com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:160) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:160) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:133) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:118) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObjectOrNull(Kryo.java:782) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:132) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[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.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(KryoSerializationScheme.kt:97) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(KryoSerializationScheme.kt:37) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme.withContext(KryoSerializationScheme.kt:80) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme.access$withContext(KryoSerializationScheme.kt:37) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1.execute(KryoSerializationScheme.kt:95) ~[corda-node-api-3.2-corda.jar:?]
    at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:61) ~[kryo-4.0.0.jar:?]
    at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme.deserialize(KryoSerializationScheme.kt:94) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66) ~[corda-core-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80) ~[corda-core-3.2-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.nodeapi.RPCApi$ServerToClient$Companion.fromClientMessage(RPCApi.kt:360) ~[corda-node-api-3.2-corda.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler.artemisMessageHandler(RPCClientProxyHandler.kt:256) ~[corda-rpc-3.2-corda.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler.access$artemisMessageHandler(RPCClientProxyHandler.kt:69) ~[corda-rpc-3.2-corda.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler$start$2.invoke(RPCClientProxyHandler.kt:197) ~[corda-rpc-3.2-corda.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler$start$2.invoke(RPCClientProxyHandler.kt:69) ~[corda-rpc-3.2-corda.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandlerKt$sam$MessageHandler$6fb61eb3.onMessage(RPCClientProxyHandler.kt) ~[corda-rpc-3.2-corda.jar:?]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:997) ~[artemis-core-client-2.2.0.jar:2.2.0]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) ~[artemis-core-client-2.2.0.jar:2.2.0]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1120) [artemis-core-client-2.2.0.jar:2.2.0]
    at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) [artemis-commons-2.2.0.jar:2.2.0]
    at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) [artemis-commons-2.2.0.jar:2.2.0]
    at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.2.0.jar:2.2.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
    Caused by: java.lang.ClassNotFoundException: net.corda.irs.contract.InterestRateSwap$State
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_181]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_181]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_181]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_181]
    at     com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:154) ~[kryo-4.0.0.jar:?]
    ... 48 more
    

注意:
如果我在单个Windows实例上运行irs-demo应用程序和NodeExplorer,则会遇到相同的例外情况

2 个答案:

答案 0 :(得分:0)

主要例外是:

Caused by: java.lang.ClassNotFoundException: net.corda.irs.contract.InterestRateSwap$State

这表明节点浏览器未安装IRS CorDapp,因此无法反序列化InterestRateSwap$State对象。

这似乎是一个错误。我在这里提出了它:https://r3-cev.atlassian.net/browse/CORDA-1992

答案 1 :(得分:0)

这是您需要手动将小姐类文件放入Node Explore中的临时方法,之后您将发现事务流进入Explorer。