错误:getLegalSearchEntities $ customCriteria1 $ 1 $ 1未注释或在白名单

时间:2017-08-03 15:20:12

标签: whitelist corda

我遇到了基于M13的问题。请帮我修理一下。你有一个通用的方法将所有类添加到白名单中吗?

我使用了customCriteria,如下所示:

val customCriteria1 = QueryCriteria.VaultCustomQueryCriteria( builder{ LegalContractSchemaV1.PersistentLegalContractState::contractTitle.equal(test.legalEntity)})

这是我的白名单。

class AppPlugin: CordaPluginRegistry() {

    override fun customizeSerialization(custom: SerializationCustomization): Boolean {
        custom.apply {
            // OpenGamma classes.
            addToWhitelist(LegalContractSchemaV1.PersistentLegalContractState::class.java)
            addToWhitelist(QueryCriteria.VaultCustomQueryCriteria::class.java)
          //  addToWhitelist(net.corda.core.node.services.vault.

        }
        return true
    }

    override val requiredSchemas: Set<MappedSchema> get() = setOf(com.legalcontract.schema.LegalContractSchemaV1) 
}
记录如下:

  

线程中的异常&#34; main&#34; com.esotericsoftware.kryo.KryoException:   类   com.legalcontract.client.LegalContractClientRPC $ getLegalSearchEntities $ customCriteria1 $ 1 $ 1   没有注释或在白名单上,所以不能使用   序列化序列化跟踪:属性   (net.corda.core.node.services.vault.Column $ Kotlin)专栏   (net.corda.core.node.services.vault.CriteriaExpression $ ColumnPredicateExpression)   表达   (net.corda.core.node.services.vault.QueryCriteria $ VaultCustomQueryCriteria)   b(net.corda.core.node.services.vault.QueryCriteria $ AndComposition)     在   net.corda.core.serialization.CordaClassResolver.checkClass(CordaClassResolver.kt:65)     在   net.corda.core.serialization.CordaClassResolver.getRegistration(CordaClassResolver.kt:35)     在com.esotericsoftware.kryo.Kryo.getRegistration(Kryo.java:488)at   net.corda.nodeapi.RPCKryo.getRegistration(RPCStructures.kt:74)at at   com.esotericsoftware.kryo.util.DefaultClassResolver.writeClass(DefaultClassResolver.java:97)     在com.esotericsoftware.kryo.Kryo.writeClass(Kryo.java:540)at at   com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:76)     在   com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.write(CompatibleFieldSerializer.java:66)     在com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)at at   com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)     在   com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.write(CompatibleFieldSerializer.java:66)     在com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)at at   com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)     在   com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.write(CompatibleFieldSerializer.java:66)     在com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:575)at at   com.esotericsoftware.kryo.serializers.ObjectField.write(ObjectField.java:80)     在   com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.write(CompatibleFieldSerializer.java:66)     at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:651)     在   com.esotericsoftware.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:100)     在   com.esotericsoftware.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:40)     at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:651)     在net.corda.core.serialization.KryoKt.serialize(Kryo.kt:169)at at   net.corda.core.serialization.KryoKt $连载$ 1.execute(Kryo.kt:151)     在net.corda.core.serialization.KryoKt $ serialize $ 1.execute(Kryo.kt)     在   com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:61)     在net.corda.core.serialization.KryoKt.serialize(Kryo.kt:151)at at   net.corda.core.serialization.KryoKt.serialize $ default(Kryo.kt:150)at at   net.corda.nodeapi.RPCApi $ ClientToServer $ RpcRequest.writeToClientMessage(RPCApi.kt:103)     在   net.corda.client.rpc.internal.RPCClientProxyHandler.invoke(RPCClientProxyHandler.kt:197)     在com.sun.proxy。$ Proxy21.vaultQueryByCriteria(未知来源)at   com.legalcontract.client.LegalContractClientRPC.getLegalSearchEntities(LegalContractClientRPC.kt:106)     在   com.legalcontract.client.LegalContractClientRPC.main(LegalContractClientRPC.kt:68)     在   com.legalcontract.client.LegalContractClientRPCKt.main(LegalContractClientRPC.kt:39)

1 个答案:

答案 0 :(得分:0)

不幸的是,这是M13的一个已知错误,因此没有为RPC正确加载白名单。 M14将于今天发布,将解决这个问题。