Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Hyperledger结构(1.4)EventHub断开连接,但未出现详细错误_Java_Hyperledger Fabric_Amazon Managed Blockchain - Fatal编程技术网

Java Hyperledger结构(1.4)EventHub断开连接,但未出现详细错误

Java Hyperledger结构(1.4)EventHub断开连接,但未出现详细错误,java,hyperledger-fabric,amazon-managed-blockchain,Java,Hyperledger Fabric,Amazon Managed Blockchain,我们在亚马逊管理的区块链(AMB)上运行Hyperledger Fabric,最近我们决定从1.2(这是AMB上很长时间以来唯一可用的版本)升级到1.4。我们使用JavaSDK连接到Hyperledger,在旧版本上还可以。重要的是,即使使用HF版本1.2,我们也使用HF SDK版本1.4.0,我们计划继续使用 在1.4中,基本上没有问题:我们可以执行主要活动,如创建/加入通道、安装链码、查询/调用它们。但是,围绕事件的功能不起作用:当我们注册侦听器时,它不起作用,我们得到以下错误: 2021-

我们在亚马逊管理的区块链(AMB)上运行Hyperledger Fabric,最近我们决定从1.2(这是AMB上很长时间以来唯一可用的版本)升级到1.4。我们使用JavaSDK连接到Hyperledger,在旧版本上还可以。重要的是,即使使用HF版本1.2,我们也使用HF SDK版本1.4.0,我们计划继续使用

在1.4中,基本上没有问题:我们可以执行主要活动,如创建/加入通道、安装链码、查询/调用它们。但是,围绕事件的功能不起作用:当我们注册侦听器时,它不起作用,我们得到以下错误:

2021-05-19 15:29:06.840 WARN 7 --- [ault-executor-0] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 4, name: eventHub0, channelName: testchanone, url: grpcs://nd-ggqg7wmp4rgwjgab5cze4cjlba.m-vbe43tw4wbg2tgenuudpgzmfg4.n-4jqyvyxtlrc3hhe7u6jwxhsxge.managedblockchain.us-east-1.amazonaws.com:30004} terminated is false shutdown is false, retry count 601 has error UNAVAILABLE: io exception.
2021-05-19 15:29:06.841 WARN 7 --- [ault-executor-0] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 4, name: eventHub0, channelName: testchanone, url: grpcs://nd-ggqg7wmp4rgwjgab5cze4cjlba.m-vbe43tw4wbg2tgenuudpgzmfg4.n-4jqyvyxtlrc3hhe7u6jwxhsxge.managedblockchain.us-east-1.amazonaws.com:30004} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: nd-ggqg7wmp4rgwjgab5cze4cjlba.m-vbe43tw4wbg2tgenuudpgzmfg4.n-4jqyvyxtlrc3hhe7u6jwxhsxge.managedblockchain.us-east-1.amazonaws.com/10.0.1.167:30004
2021-05-19T18:29:06.841+03:00   Caused by: java.net.ConnectException: Connection refused
2021-05-19T18:29:06.841+03:00   at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
2021-05-19T18:29:06.841+03:00   at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716)
2021-05-19T18:29:06.841+03:00   at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327)
2021-05-19T18:29:06.841+03:00   at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:336)
2021-05-19T18:29:06.841+03:00   at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:685)
2021-05-19T18:29:06.841+03:00   at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
2021-05-19T18:29:06.841+03:00   at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
2021-05-19T18:29:06.841+03:00   at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
2021-05-19T18:29:06.841+03:00   at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
2021-05-19T18:29:06.841+03:00   at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2021-05-19T18:29:06.841+03:00   at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2021-05-19T18:29:06.841+03:00   at java.lang.Thread.run(Thread.java:748)
2021-05-19T18:29:06.841+03:00   }. Description io exception
最糟糕的是,错误并没有说明具体的原因:相同的配置和设置适用于HF 1.2(其他功能也适用),类似的设置适用于HF 1.4,很久以前我们将其作为自托管解决方案使用时

这是我们在创建频道时注册事件中心的方式:

。。。
属性channelProperties=新属性();
channelProperties.put(“pemBytes”,commonCaPem.getBytes());
setProperty(“sslProvider”、“openSSL”);
channelProperties.setProperty(“negotiationType”、“TLS”);
channelProperties.put(“grpc.NettyChannelBuilderOption.keepAliveTime”,新对象[]{5L,TimeUnit.MINUTES});
channelProperties.put(“grpc.NettyChannelBuilderOption.keepAliveTimeout”,新对象[]{60L,TimeUnit.SECONDS});
channelProperties.put(“grpc.NettyChannelBuilderOption.keepAliveWithoutCalls”,新对象[]{true});
...
ChannelConfiguration ChannelConfiguration=新的ChannelConfiguration(
新文件(generatedGenesisFile));
字节[]channelConfigSigs=client.getChannelConfigurationSignature(channelConfiguration,adminUserContext);
channel=client.newChannel(params.getChannelName(),orders.stream().findAny())
.orelsetrow(()->新的InvalidArgumentException(“在配置中找不到任何订购者”)、channelConfiguration、channelConfigSigs);
...
List eventHubList=newarraylist(this.eventhubbs);
对于(int i=0;i
事件中心地址总是已知且正确的,我们会从HF节点配置中自动设置它们

这是我们注册事件侦听器的方式:

。。。
字符串listenerHandle=container.getChannel().registerChaincodeEventListener(
Pattern.compile(params.getChaincodeName()+“*”),
Pattern.compile(params.getQuotePattern()?Pattern.quote(params.getPattern()):params.getPattern()),
(句柄、块事件、链码事件)->{
//实际事件处理程序
}
);
...
如果您需要更多详细信息,我将添加它们。就目前的问题而言,我真的不确定如何正确处理它


提前谢谢你

我在错误中看到了这一点,这似乎很好地说明了原因:“连接被拒绝:nd-ggqg7wmp4rgwjgab5cze4cjlba.m-vbe43tw4wbg2tgnudpgzmfg4.n-4jqyvytlrc3he7u6jwxhsge.managedblockschain.us-east-1.amazonaws.com/10.0.1.167:30004”