我正在使用M13(将尽快转移到M14)。看到这个例外:
com.esotericsoftware.kryo.KryoException: Class kotlin.KotlinNullPointerException is not annotated or on the whitelist, so cannot be used in serialization
紧接着:
E 15:11:10 [rpc-observation-sender-0] messaging.ObservableContext.sendMessage - Failed to send message, kicking client. Message was Observation(id=ObservableId(toLong=8088750694041100169), content=[rx.Notification@9edc8e12 OnError null])
尝试从客户端RPC调用我自己的流时。我检查过自定义数据类型具有@CordaSerializable属性。
我已经看到另一个问题的答案,表明M13中存在与RPC序列化有关的错误。这可以解释上述异常吗?
我真的坚持这一点,所以任何帮助都会非常感激。
完整堆栈跟踪:
E 15:11:10 [rpc-observation-sender-0] messaging.ObservableContext.sendMessage - Failed to send message, kicking client. Message was Observation(id=ObservableId(toLong=8088750694041100169), content=[rx.Notification@9edc8e12 OnError null])
com.esotericsoftware.kryo.KryoException: Class kotlin.KotlinNullPointerException is not annotated or on the whitelist, so cannot be used in serialization
Serialization trace:
throwable (rx.Notification)
at net.corda.core.serialization.CordaClassResolver.checkClass(CordaClassResolver.kt:65) ~[main/:?]
at net.corda.core.serialization.CordaClassResolver.getRegistration(CordaClassResolver.kt:35) ~[main/:?]
at com.esotericsoftware.kryo.Kryo.getRegistration(Kryo.java:488) ~[kryo-4.0.0.jar:?]
at net.corda.nodeapi.RPCKryo.getRegistration(RPCStructures.kt:74) ~[main/:?]
at com.esotericsoftware.kryo.util.DefaultClassResolver.writeClass(DefaultClassResolver.java:97) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.Kryo.writeClass(Kryo.java:540) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:76) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.write(CompatibleFieldSerializer.java:66) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:651) ~[kryo-4.0.0.jar:?]
at net.corda.core.serialization.KryoKt.serialize(Kryo.kt:169) ~[main/:?]
at net.corda.core.serialization.KryoKt$serialize$1.execute(Kryo.kt:151) ~[main/:?]
at net.corda.core.serialization.KryoKt$serialize$1.execute(Kryo.kt) ~[main/:?]
at net.corda.core.serialization.KryoPoolWithContext.run(Kryo.kt:652) ~[main/:?]
at net.corda.core.serialization.KryoKt.serialize(Kryo.kt:151) ~[main/:?]
at net.corda.core.serialization.KryoKt.serialize$default(Kryo.kt:150) ~[main/:?]
at net.corda.nodeapi.RPCApi$ServerToClient$Observation.writeToClientMessage(RPCApi.kt:170) ~[main/:?]
at net.corda.node.services.messaging.ObservableContext.sendMessage(RPCServer.kt:411) [main/:?]
at net.corda.node.services.messaging.RpcServerObservableSerializer$write$observableWithSubscription$1$onNext$1.run(RPCServer.kt:446) [main/:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
E 15:54:42 [Thread-4 (ActiveMQ-client-global-threads)] internal.RPCClientProxyHandler.artemisMessageHandler - RPC reply arrived to unknown RPC ID RpcRequestId(toLong=8669965257690653719), this indicates an internal RPC error.
E 15:54:42 [Thread-4 (ActiveMQ-client-global-threads)] internal.RPCClientProxyHandler.artemisMessageHandler - RPC reply arrived to unknown RPC ID RpcRequestId(toLong=6979460553466678543), this indicates an internal RPC error.
E 15:54:42 [Thread-4 (ActiveMQ-client-global-threads)] internal.RPCClientProxyHandler.artemisMessageHandler - RPC reply arrived to unknown RPC ID RpcRequestId(toLong=2006512959418997107), this indicates an internal RPC error.
答案 0 :(得分:0)
这是由于KotlinNullPointerException
被引入流中引起的。 KotlinNullPointerException
不在RPC客户端序列化白名单中,因此抛出此错误,而不是根本原因。
我们正在调查为什么KotlinNullPointerException
在RPC客户端白名单上,但不在节点白名单上:https://github.com/corda/corda/issues/1268。