0

I got to the project that is based on BYFN sample, but limited to one organization only.

In the app when I call following code:

private Contract getContract(Gateway gw) {
    return gw.getNetwork("mychannel").getContract("realchain");
}

following error is produced:

2019-10-30 09:34:51.433  INFO 23108 --- [nio-8080-exec-3] org.hyperledger.fabric.gateway.Gateway   : Unable to load channel configuration from connection profile:

org.hyperledger.fabric.sdk.exception.NetworkConfigurationException: Channel configuration has no channels defined.
    at org.hyperledger.fabric.sdk.NetworkConfig.loadChannel(NetworkConfig.java:519) ~[fabric-sdk-java-1.4.5-20190620.151745-1.jar:na]
    at org.hyperledger.fabric.sdk.HFClient.loadChannelFromConfig(HFClient.java:161) ~[fabric-sdk-java-1.4.5-20190620.151745-1.jar:na]
    at org.hyperledger.fabric.gateway.impl.GatewayImpl.getNetwork(GatewayImpl.java:258) ~[fabric-gateway-java-1.4.0-20191002.055106-31.jar:na]
    ...

...the app recovers somehow itself, but I suspect this error to slow down the whole interaction with the ledger.

Also I'd love to keep my logs clean from any exceptions if possible.

Anyone encountered and resolved the same error?

4

1 回答 1

1

那是正常的行为。如果连接配置文件不包含通道定义,则客户端使用对等定义(当前仅用于您的客户端身份的组织)并假定这些对等点存在通道。它根本不应该影响性能。

您可以选择将通道定义添加到连接配置文件,这将避免出现此日志消息,但我们希望避免这种情况是必要的。

我同意日志中出现的异常给人一种错误的印象,即发生了真正的错误,我已经在当前的开发代码中删除了它。

于 2019-10-30T09:45:45.517 回答