ClassCastException в Bouncy Castle в Cordite Network Map Service при получении информации о стороннем узле - PullRequest
0 голосов
/ 27 декабря 2018

Привет! Я использую Cordite NMS, я настроил узлы, развернул DApp и настроил отдельное приложение Spring Boot, которое вызывает узел через RCP. Я пытался выполнить транзакцию, например создание IOU, для этого я создалCordaRPCOps на стороне Webapp, и он успешно создается для стороны A, затем я хочу получить сторону B через:Party otherParty = rpcOps.wellKnownPartyFromX500Name(CordaX500Name);здесь я получаю ниже ClassCastException:

На самом деле я хотел настроить NMS Cordite как NMS и корневой CA, я настроил все узлы и NMS в соответствии с объяснением, предоставленным Cordite:https://gitlab.com/cordite/network-map-service/blob/master/FAQ.md#using-java

E 02:13:52 63 client.run - AMQ214000: Failed to call onMessage
com.esotericsoftware.kryo.KryoException: java.lang.ClassCastException: org.bouncycastle.asn1.DLSequence cannot be cast to org.bouncycastle.asn1.ASN1Integer
Serialization trace:
owningKey (net.corda.core.identity.Party)
value (net.corda.core.utilities.Try$Success)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:144) ~[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.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(KryoSerializationScheme.kt:37) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme.withContext(KryoSerializationScheme.kt:80) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme.access$withContext(KryoSerializationScheme.kt:37) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.kryo.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1.execute(KryoSerializationScheme.kt:95) ~[corda-node-api-3.3-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.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66) ~[corda-core-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80) ~[corda-core-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.nodeapi.RPCApi$ServerToClient$Companion.fromClientMessage(RPCApi.kt:360) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler.artemisMessageHandler(RPCClientProxyHandler.kt:268) ~[corda-rpc-3.3-corda.jar:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler.access$artemisMessageHandler(RPCClientProxyHandler.kt:71) ~[corda-rpc-3.3-corda.jar:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler$start$3.invoke(RPCClientProxyHandler.kt:206) ~[corda-rpc-3.3-corda.jar:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler$start$3.invoke(RPCClientProxyHandler.kt:71) ~[corda-rpc-3.3-corda.jar:?]
at net.corda.client.rpc.internal.RPCClientProxyHandlerKt$sam$MessageHandler$26468063.onMessage(RPCClientProxyHandler.kt) ~[corda-rpc-3.3-corda.jar:?]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1011) ~[artemis-core-client-2.6.3.jar:2.6.3]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:50) ~[artemis-core-client-2.6.3.jar:2.6.3]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1134) ~[artemis-core-client-2.6.3.jar:2.6.3]
at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) ~[artemis-commons-2.6.3.jar:2.6.3]
at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) ~[artemis-commons-2.6.3.jar:2.6.3]
at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:66) ~[artemis-commons-2.6.3.jar:2.6.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_172]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_172]
at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.6.3.jar:2.6.3]

Caused by: java.lang.ClassCastException: org.bouncycastle.asn1.DLSequence cannot be cast to org.bouncycastle.asn1.ASN1Integer
at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.<init>(Unknown Source) ~[bcprov-jdk15on-1.57.jar:1.57.0]
at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.getInstance(Unknown Source) ~[bcprov-jdk15on-1.57.jar:1.57.0]
at net.corda.core.crypto.Crypto.decodePrivateKey(Crypto.kt:301) ~[corda-core-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.kryo.PrivateKeySerializer.read(Kryo.kt:322) ~[corda-node-api-3.3-corda.jar:?]
at net.corda.nodeapi.internal.serialization.kryo.PrivateKeySerializer.read(Kryo.kt:314) ~[corda-node-api-3.3-corda.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:?]
... 33 more
...