我不太习惯 java 世界,所以我不确定我的问题是在我的 Azure 设置上,还是在 java 设置上。在尝试下面的教程后,我遇到了以下异常。
https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-java-get-started-receive-eph
Failure while registering:
com.microsoft.azure.eventprocessorhost.EPHConfigurationException:
Encountered error while fetching the list of EventHub PartitionIds:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target
示例中的这一行发生异常:
host.registerEventProcessor(EventProcessor.class, options).get();
我完成了本教程的 .NET 版本,几乎没有问题。在这种情况下发送和接收有效。有什么见解吗?这几天我一直在摸索,但没有运气。
最佳答案
我搜索了您的问题,找到了一些有用的博客,可以帮助解决问题,请引用以下博客。
- https://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/
- http://nodsw.com/blog/leeland/2006/12/06-no-more-unable-find-valid-certification-path-requested-target
以上博客均使用了工具InstallCert
到可以添加到本地 keystore 的服务器证书。请遵循 GitHub 存储库的自述文件。
关于Java 连接到 azure 事件中心 : SunCertPathBuilderException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42162987/