我在我的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?
发布评论