Corda - java.lang.IllegalArgumentException being thrown from a validating notary

随声附和 提交于 2019-12-24 20:24:39

问题


I am getting the following exception from a validating notary:

java.lang.IllegalArgumentException: Not a valid Java name: java.util.Set<example.mypackage.MyClass>

MyClass is located in the states/contracts jar

Stack Trace

java.io.NotSerializableException: Unexpected throwable: net.corda.core.transactions.WireTransaction -> net.corda.core.transactions.WireTransaction -> null java.lang.reflect.InvocationTargetException: net.corda.core.transactions.WireTransaction -> net.corda.core.transactions.WireTransaction -> null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at net.corda.nodeapi.internal.serialization.amqp.ObjectSerializer.construct(ObjectSerializer.kt:138)
    at net.corda.nodeapi.internal.serialization.amqp.ObjectSerializer.readObjectBuildViaConstructor(ObjectSerializer.kt:97)
    at net.corda.nodeapi.internal.serialization.amqp.ObjectSerializer.readObject(ObjectSerializer.kt:82)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObject$node_api(DeserializationInput.kt:135)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObjectOrNull$node_api(DeserializationInput.kt:109)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObjectOrNull$node_api$default(DeserializationInput.kt:108)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput$deserialize$1.invoke(DeserializationInput.kt:98)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.des(DeserializationInput.kt:80)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.deserialize(DeserializationInput.kt:96)
    at net.corda.nodeapi.internal.serialization.amqp.AbstractAMQPSerializationScheme.deserialize(AMQPSerializationScheme.kt:123)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111)
    at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86)
    at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111)
    at net.corda.core.transactions.SignedTransaction.getCoreTransaction(SignedTransaction.kt:272)
    at net.corda.core.transactions.SignedTransaction.getInputs(SignedTransaction.kt:71)
    at net.corda.node.services.transactions.ValidatingNotaryFlow.receiveTransaction(ValidatingNotaryFlow.kt:50)
    at net.corda.node.services.transactions.ValidatingNotaryFlow.receiveAndVerifyTx(ValidatingNotaryFlow.kt:30)
    at net.corda.core.flows.NotaryFlow$Service.call(NotaryFlow.kt:142)
    at net.corda.core.flows.NotaryFlow$Service.call(NotaryFlow.kt:133)
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96)
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44)
    at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092)
    at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788)
    at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100)
    at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62)
Caused by: java.lang.Exception: Malformed transaction, OUTPUTS_GROUP at index 0 cannot be deserialised
    at net.corda.core.transactions.TraversableTransaction.deserialiseComponentGroup(MerkleTransaction.kt:70)
    at net.corda.core.transactions.TraversableTransaction.<init>(MerkleTransaction.kt:25)
    at net.corda.core.transactions.WireTransaction.<init>(WireTransaction.kt:43)
    ... 39 more
Caused by: java.io.NotSerializableException: Unexpected throwable: Not a valid Java name: java.util.Set<com.tradeix.concord.domain.models.FundingResponseInvoiceProposal> java.lang.IllegalArgumentException: Not a valid Java name: java.util.Set<com.tradeix.concord.domain.models.FundingResponseInvoiceProposal>
    at net.corda.nodeapi.internal.serialization.carpenter.ClassCarpenter.validateSchema(ClassCarpenter.kt:410)
    at net.corda.nodeapi.internal.serialization.carpenter.ClassCarpenter.build(ClassCarpenter.kt:106)
    at net.corda.nodeapi.internal.serialization.carpenter.MetaCarpenterBase.step(MetaCarpenter.kt:69)
    at net.corda.nodeapi.internal.serialization.carpenter.MetaCarpenter.build(MetaCarpenter.kt:98)
    at net.corda.nodeapi.internal.serialization.amqp.SerializerFactory.processSchema(SerializerFactory.kt:235)
    at net.corda.nodeapi.internal.serialization.amqp.SerializerFactory.processSchema$default(SerializerFactory.kt:216)
    at net.corda.nodeapi.internal.serialization.amqp.SerializerFactory$get$1.invoke(SerializerFactory.kt:185)
    at net.corda.nodeapi.internal.serialization.amqp.SerializerFactory$get$1.invoke(SerializerFactory.kt:40)
    at net.corda.nodeapi.internal.serialization.amqp.SerializerFactory.get(SerializerFactory.kt:184)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObject$node_api(DeserializationInput.kt:131)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObjectOrNull$node_api(DeserializationInput.kt:109)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObjectOrNull$node_api$default(DeserializationInput.kt:108)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput$deserialize$1.invoke(DeserializationInput.kt:98)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.des(DeserializationInput.kt:80)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.deserialize(DeserializationInput.kt:96)
    at net.corda.nodeapi.internal.serialization.amqp.AbstractAMQPSerializationScheme.deserialize(AMQPSerializationScheme.kt:123)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111)
    at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86)
    at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111)
    at net.corda.core.transactions.TraversableTransaction$outputs$1.invoke(MerkleTransaction.kt:356)
    at net.corda.core.transactions.TraversableTransaction$outputs$1.invoke(MerkleTransaction.kt:18)
    at net.corda.core.transactions.TraversableTransaction.deserialiseComponentGroup(MerkleTransaction.kt:66)
    at net.corda.core.transactions.TraversableTransaction.<init>(MerkleTransaction.kt:25)
    at net.corda.core.transactions.WireTransaction.<init>(WireTransaction.kt:43)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at net.corda.nodeapi.internal.serialization.amqp.ObjectSerializer.construct(ObjectSerializer.kt:138)
    at net.corda.nodeapi.internal.serialization.amqp.ObjectSerializer.readObjectBuildViaConstructor(ObjectSerializer.kt:97)
    at net.corda.nodeapi.internal.serialization.amqp.ObjectSerializer.readObject(ObjectSerializer.kt:82)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObject$node_api(DeserializationInput.kt:135)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObjectOrNull$node_api(DeserializationInput.kt:109)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.readObjectOrNull$node_api$default(DeserializationInput.kt:108)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput$deserialize$1.invoke(DeserializationInput.kt:98)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.des(DeserializationInput.kt:80)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.deserialize(DeserializationInput.kt:96)
    at net.corda.nodeapi.internal.serialization.amqp.AbstractAMQPSerializationScheme.deserialize(AMQPSerializationScheme.kt:123)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111)
    at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86)
    at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111)
    at net.corda.core.transactions.SignedTransaction.getCoreTransaction(SignedTransaction.kt:272)
    at net.corda.core.transactions.SignedTransaction.getInputs(SignedTransaction.kt:71)
    at net.corda.node.services.transactions.ValidatingNotaryFlow.receiveTransaction(ValidatingNotaryFlow.kt:50)
    at net.corda.node.services.transactions.ValidatingNotaryFlow.receiveAndVerifyTx(ValidatingNotaryFlow.kt:30)
    at net.corda.core.flows.NotaryFlow$Service.call(NotaryFlow.kt:142)
    at net.corda.core.flows.NotaryFlow$Service.call(NotaryFlow.kt:133)
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96)
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44)
    at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092)
    at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788)
    at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100)
    at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62)

    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.des(DeserializationInput.kt:84)
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.deserialize(DeserializationInput.kt:96)
    at net.corda.nodeapi.internal.serialization.amqp.AbstractAMQPSerializationScheme.deserialize(AMQPSerializationScheme.kt:123)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111)
    at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86)
    at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80)
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111)
    at net.corda.core.transactions.TraversableTransaction$outputs$1.invoke(MerkleTransaction.kt:356)
    at net.corda.core.transactions.TraversableTransaction$outputs$1.invoke(MerkleTransaction.kt:18)
    at net.corda.core.transactions.TraversableTransaction.deserialiseComponentGroup(MerkleTransaction.kt:66)
    ... 41 more

    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.des(DeserializationInput.kt:84) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.amqp.DeserializationInput.deserialize(DeserializationInput.kt:96) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.amqp.AbstractAMQPSerializationScheme.deserialize(AMQPSerializationScheme.kt:123) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:111) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:66) ~[corda-core-3.1-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:111) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:86) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:80) ~[corda-core-3.1-corda.jar:?]
    at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:111) ~[corda-node-api-3.1-corda.jar:?]
    at net.corda.core.transactions.SignedTransaction.getCoreTransaction(SignedTransaction.kt:272) ~[corda-core-3.1-corda.jar:?]
    at net.corda.core.transactions.SignedTransaction.getInputs(SignedTransaction.kt:71) ~[corda-core-3.1-corda.jar:?]
    at net.corda.node.services.transactions.ValidatingNotaryFlow.receiveTransaction(ValidatingNotaryFlow.kt:50) ~[corda-node-3.1-corda.jar:?]
    at net.corda.node.services.transactions.ValidatingNotaryFlow.receiveAndVerifyTx(ValidatingNotaryFlow.kt:30) ~[corda-node-3.1-corda.jar:?]
    at net.corda.core.flows.NotaryFlow$Service.call(NotaryFlow.kt:142) ~[corda-core-3.1-corda.jar:?]
    at net.corda.core.flows.NotaryFlow$Service.call(NotaryFlow.kt:133) ~[corda-core-3.1-corda.jar:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96) [corda-node-3.1-corda.jar:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44) [corda-node-3.1-corda.jar:?]
    at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_172]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_172]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_172]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_172]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172]
    at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62) [corda-node-3.1-corda.jar:?]

Any idea on this exception and its possible origin?

Note this issue seems not to occur for non-validating notaries.


回答1:


This is probably because the JAR containing MyClass was not present on the validating notary's classpath. As of Corda 3, you need to install it on the notary, in the same way you'd install it on a regular node.



来源:https://stackoverflow.com/questions/54109475/corda-java-lang-illegalargumentexception-being-thrown-from-a-validating-notary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!