Java 连接到 azure 事件中心 : SunCertPathBuilderException

标签 java azure azure-eventhub

我不太习惯 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 版本,几乎没有问题。在这种情况下发送和接收有效。有什么见解吗?这几天我一直在摸索,但没有运气。

最佳答案

我搜索了您的问题,找到了一些有用的博客,可以帮助解决问题,请引用以下博客。

  1. https://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/
  2. 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/

相关文章:

azure-data-lake - Azure 事件中心在启用 Data Lake Gen2 的情况下捕获到存储

azure - Azure WebJob 内的 EventHub 注册处理器无法正常工作

java - Java 中的字符串行为

java - 在 Java 17 上运行 Eclipse 时出错

java - 从 IDEA 调试 Webstorm 的插件

java - 使用 HttpClient 写入正文请求

azure - 将 azure 移动服务 autofac 与 nservicebus 注册相结合

azure - 如果 CNAME 已存在,为什么 Azure 应用服务中需要自定义域?

azure - 我可以从 Azure Cosmos DB 读取/加载文档并同时获取其写入锁定吗?

node.js - 为什么 Azure 事件中心获取事件的速度如此之慢?