我正在将cordapp从Corda v1.0迁移到Corda v4.0。我正在遵循逐步迁移方法。
将cordapp从Corda v1.0迁移到Corda v2.0时,节点已成功部署并运行,但是在运行Springboot Web服务器时,我得到了错误-“ java.lang.ClassNotFoundException:net.corda.bgc。合同cmd窗口中的“ contract.State”。
[节点和Web服务器在Corda v1.0中成功运行。]
以下是错误的详细信息-
Springbootweb服务器成功启动后会冻结 连接到CorDapp时。以下是Web服务器cmd窗口中的stacktrace-
I 17:50:49 1 Server.doStart - Started @29133ms
I 17:50:54 1 RPCClient.logElapsedTime - Startup took 3682 msec
<==I 17:50:54 1 ThreadPoolTaskExecutor.initialize - Initializing ExecutorService 'clientInboundChannelExecutor'
I 17:50:54 1 ThreadPoolTaskExecutor.initialize - Initializing ExecutorService 'clientOutboundChannelExecutor'
> :server:runMyCorpUSAServer
以下是节点cmd窗口中的堆栈跟踪-
Mon Jun 03 18:08:07 IST 2019>>> E 18:09:20+0530 [Thread-1 (ActiveMQ-client-global-threads)] core.client.run - AMQ214000: Failed to call onMessage
java.lang.ClassNotFoundException: net.corda.bgc.contract.State
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_212]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_212]
at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_212]
at net.corda.nodeapi.internal.serialization.ClassSerializer.read(Kryo.kt:526) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.ClassSerializer.read(Kryo.kt:523) ~[corda-node-api-2.0.0.jar:?]
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.serializers.DefaultSerializers$CollectionsSingletonListSerializer.read(DefaultSerializers.java:577) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.serializers.DefaultSerializers$CollectionsSingletonListSerializer.read(DefaultSerializers.java:567) ~[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.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(SerializationScheme.kt:209) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(SerializationScheme.kt:152) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme.withContext(SerializationScheme.kt:191) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme.access$withContext(SerializationScheme.kt:152) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1.execute(SerializationScheme.kt:206) ~[corda-node-api-2.0.0.jar:?]
at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:61) ~[kryo-4.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme.deserialize(SerializationScheme.kt:205) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:115) ~[corda-node-api-2.0.0.jar:?]
at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:53) ~[corda-core-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:115) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:95) ~[corda-node-api-2.0.0.jar:?]
at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:67) ~[corda-core-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:115) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.RPCApi$ClientToServer$Companion.fromClientMessage(RPCApi.kt:234) ~[corda-node-api-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer.clientArtemisMessageHandler(RPCServer.kt:263) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer.access$clientArtemisMessageHandler(RPCServer.kt:76) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:189) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:76) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServerKt$sam$MessageHandler$b852d39b.onMessage(RPCServer.kt) ~[corda-node-2.0.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_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_212]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_212]
请提供有关上述内容的见解。
谢谢。
答案 0 :(得分:0)
通过将cordapp jar文件复制到每个节点的“ plugins”目录中,该问题得以解决。
在Corda V1中,该过程将cordapp jar文件复制到每个节点的“ plugins”目录中,而在Corda V2中,似乎我们必须手动进行。如果我错了,请纠正我。