无法查找主机replica-set.xxx.mongodb.net的txt记录

发布于 2025-02-05 08:31:24 字数 1049 浏览 1 评论 0 原文

我在我的Java Spring应用程序的stacktrace中遇到了此错误:

引起的:com.mongodb.mongoconfigurationException:无法查找host< endpoint> .mongodb.net> .mongodb.net

[[ ...]

javax.naming.namenotfoundException:找不到DNS名称[响应代码3]

我可以验证我可以通过与完全相同的连接字符串(但是当我运行此应用程序,我会收到此错误。

我的春季引导版本是: 2.6.6 。弹簧数据的依赖性是: org.springframework.boot:spring-boot-starter-starter-starter-data-mongodb:2.6.6

我尝试过的事情:

我遇到的问题与此 so post 。我尝试更新本地的Windows防火墙,以允许那些入站/出站端口(并重新启动我的机器),但没有骰子。

然后,我尝试更新我的DNS设置,以便在我的Windows网络适配器上使用Google的8.8.8.8用于IPv4,但也没有骰子。

我还看到了有关Java Mongo驱动程序的固定问题,上面抛出了完全相同的例外,。因此,我尝试将我的春季数据mongo依赖项更新为 v2.7.0 ,但也没有骰子。

还有其他建议吗?

I am getting this error in my stacktrace of my Java Spring app:

Caused by: com.mongodb.MongoConfigurationException: Unable to look up TXT record for host <endpoint>.mongodb.net

[...]

javax.naming.NameNotFoundException: DNS name not found [response code 3]

I can verify that I can connect to this MongoDB via Robo3T with the exact same connection string but when I run this app, I get this error.

My Spring Boot version is: 2.6.6. And the dependency for Spring Data is: org.springframework.boot:spring-boot-starter-data-mongodb:2.6.6.

Things I've tried:

The issue I'm running into is very similar to this SO post. I tried updating my local Windows firewall to allow for those inbound/outbound ports (and restarted my machine) but no dice.

I then tried to update my DNS settings to use Google's 8.8.8.8 on my Windows network adapter for IPv4 but also no dice.

I also saw this fixed issue about the Java Mongo driver throwing the exact same exception above, https://jira.mongodb.org/browse/JAVA-4018. So I then tried to update my Spring Data Mongo dependencies to v2.7.0 but also no dice.

Any other suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文