问题描述
我试图通过在我的应用程序中添加r3提供的toolkit作为corrdapp的依赖关系来配置解决方案中的业务网络运营商服务。我能够构建该应用程序,但是当我运行节点时,我的公证人报错了
更新
我正在添加日志
[ERROR] 2020-09-04T14:21:15,399Z [main] internal.Node. - Unable to install Corda service com.r3.businessnetworks.membership.flows.bno.service.BNOConfigurationService - [errorCode=dfc7g6,moreinformationAt=https://errors.corda.net/OS/4.5/dfc7g6]
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_201]
[...]
at net.corda.node.Corda.main(Corda.kt:13) ~[corda-node-4.5.jar:?]
Caused by: java.lang.NullPointerException
at com.r3.businessnetworks.membership.flows.ConfigUtils.loadConfig(ConfigUtils.kt:16) ~[?:?]
at com.r3.businessnetworks.membership.flows.bno.service.BNOConfigurationService.<init>(BNOConfigurationService.kt:21) ~[?:?]
... 33 more
[ERROR] 2020-09-04T14:21:15,458Z [main] internal.NodeStartupLogging. - Exception during node startup - [errorCode=dfc7g6,moreinformationAt=https://errors.corda.net/OS/4.5/dfc7g6]
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_201]
[...]
at net.corda.cliutils.CordaCliWrapperKt.start(CordaCliWrapper.kt:89) ~[corda-tools-cliutils-4.5.jar:?]
at net.corda.node.Corda.main(Corda.kt:13) ~[corda-node-4.5.jar:?]
Caused by: java.lang.NullPointerException
at com.r3.businessnetworks.membership.flows.ConfigUtils.loadConfig(ConfigUtils.kt:16) ~[?:?]
at com.r3.businessnetworks.membership.flows.bno.service.BNOConfigurationService.<init>(BNOConfigurationService.kt:21) ~[?:?]
... 33 more
解决方法
您缺少此CorDapp的配置文件,如here所述;您必须:
- 在节点的
config
文件夹(即cordapps
)内创建一个node-folder/cordapps/config
文件夹。 - 在该文件夹中创建一个
membership-service.conf
文件。 - 在该文件中添加:
// Whitelist of accepted BNOs. Attempt to communicate to not whitelisted // BNO would result into an exception bnoWhitelist = ["O=BNO,L=New York,C=US","O=BNO,L=London,C=GB"] // Name of the notary to use for BNO transactions such as membership approval notaryName = "O=Notary,L=Longon,C=GB"
您使用的CorDapp依赖于配置文件(上面的3个步骤创建了该文件),并且在缺少NullPointerException
时会导致它。要了解有关CorDapp配置文件的更多信息,请阅读my article。
在旁注中,根据this;您使用的CorDapp将于2020年9月31日弃用。