При выполнении любого vaultQuery получение java .io.NotSerializableException на net .corda.core.node.services.Vault $ ConstraintInfo , my Cordapp построен на v3.1 и работает на Corda jar v4.1 . Я использую версию Enterprise для обоих.
Я проверил, что ConstraintInfo принадлежит Corda 4.x и отсутствует в 3.x, и я запустил то же приложение на Corda jar v3.1 и он работает без сбоев. Это проблема совместимости? Или есть какое-нибудь решение?
Вот фрагмент кода VaultQuery, который я выполняю:
fun getDummyRequestFromVault(proxy: CordaRPCOps?, lid: String): TransactionState<DummyRequestState> {
val expr = builder { DummyRequestSchemaV1.DummyRequest::requestId.equal(lid) }
val criteria = QueryCriteria.VaultCustomQueryCriteria(expr)
val stateandref = proxy!!.vaultQueryByCriteria(criteria, DummyRequestState::class.java).states.singleOrNull()
?: throw Exception("Zero or many states found in vault. Should only be one for this linear ID")
return stateandref.state
}
Не удается получить val stateandref и исключение:
[ERROR] 2020-07-13T02:43:06,213 [Thread-2 (ActiveMQ-client-global-threads)] org.apache.activemq.artemis.core.client - AMQ214000: Failed to call onMessage
java.io.NotSerializableException: net.corda.core.utilities.Try$Success -> net.corda.core.utilities.Try$Success -> value(java.lang.Object) -> states(java.util.List) -> net.corda.core.node.services.Vault$ConstraintInfo
at net.corda.serialization.internal.amqp.EvolutionSerializer$Companion.make(EvolutionSerializer.kt:191) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.EvolutionSerializerGetter$getEvolutionSerializer$1.apply(EvolutionSerializer.kt:299) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.EvolutionSerializerGetter$getEvolutionSerializer$1.apply(EvolutionSerializer.kt:292) ~[corda-serialization-3.1.jar!/:?]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[?:1.8.0_252]
at net.corda.serialization.internal.amqp.EvolutionSerializerGetter.getEvolutionSerializer(EvolutionSerializer.kt:297) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.SerializerFactory.getEvolutionSerializer(SerializerFactory.kt:105) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.SerializerFactory.processSchema(SerializerFactory.kt:285) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.SerializerFactory.processSchema$default(SerializerFactory.kt:274) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.SerializerFactory$get$2.invoke(SerializerFactory.kt:241) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.SerializerFactory$get$2.invoke(SerializerFactory.kt:55) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.SerializerFactory.get(SerializerFactory.kt:239) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.readObject$serialization(DeserializationInput.kt:158) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.readObjectOrNull$serialization(DeserializationInput.kt:136) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.PropertySerializer$DescribedTypePropertySerializer.readProperty(PropertySerializer.kt:92) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.EvolutionSerializer$OldParam.readProperty(EvolutionSerializer.kt:60) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.EvolutionSerializerViaConstructor.readObject(EvolutionSerializer.kt:237) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.readObject$serialization(DeserializationInput.kt:165) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.readObjectOrNull$serialization(DeserializationInput.kt:136) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.PropertySerializer$DescribedTypePropertySerializer.readProperty(PropertySerializer.kt:92) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.ObjectSerializer.readObjectBuildViaConstructor(ObjectSerializer.kt:121) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.ObjectSerializer.readObject(ObjectSerializer.kt:103) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.readObject$serialization(DeserializationInput.kt:165) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.readObjectOrNull$serialization(DeserializationInput.kt:136) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput$deserialize$1.invoke(DeserializationInput.kt:113) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.des(DeserializationInput.kt:91) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.DeserializationInput.deserialize(DeserializationInput.kt:108) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.amqp.AbstractAMQPSerializationScheme.deserialize(AMQPSerializationScheme.kt:190) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:136) ~[corda-serialization-3.1.jar!/:?]
at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:77) ~[corda-core-3.1.jar!/:?]
at net.corda.serialization.internal.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:136) ~[corda-serialization-3.1.jar!/:?]
at net.corda.serialization.internal.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:106) ~[corda-serialization-3.1.jar!/:?]
at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:91) ~[corda-core-3.1.jar!/:?]
at net.corda.serialization.internal.SerializationFactoryImpl.deserialize(SerializationScheme.kt:136) ~[corda-serialization-3.1.jar!/:?]
at net.corda.nodeapi.RPCApi$ServerToClient$Companion.fromClientMessage(RPCApi.kt:370) ~[corda-node-api-3.1.jar!/:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler.artemisMessageHandler(RPCClientProxyHandler.kt:301) ~[corda-rpc-3.1.jar!/:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler.access$artemisMessageHandler(RPCClientProxyHandler.kt:97) ~[corda-rpc-3.1.jar!/:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler$initSessions$1.invoke(RPCClientProxyHandler.kt:503) ~[corda-rpc-3.1.jar!/:?]
at net.corda.client.rpc.internal.RPCClientProxyHandler$initSessions$1.invoke(RPCClientProxyHandler.kt:97) ~[corda-rpc-3.1.jar!/:?]
at net.corda.client.rpc.internal.RPCClientProxyHandlerKt$sam$org_apache_activemq_artemis_api_core_client_MessageHandler$0.onMessage(RPCClientProxyHandler.kt) ~[corda-rpc-3.1.jar!/:?]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1003) ~[artemis-core-client-2.4.0.jar!/:2.4.0]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:50) ~[artemis-core-client-2.4.0.jar!/:2.4.0]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1126) [artemis-core-client-2.4.0.jar!/:2.4.0]
at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) [artemis-commons-2.4.0.jar!/:2.4.0]
at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) [artemis-commons-2.4.0.jar!/:2.4.0]
at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.4.0.jar!/:2.4.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]