我正在尝试连接来自MongoDB云的负载数据。我的代码可以在其他笔记本电脑上正常工作。但这会在我的笔记本电脑上出现此错误。我用谷歌搜索了很多东西,但是找不到解决这个问题的方法。
May 28, 2020 6:36:50 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Cluster created with settings {hosts=[cluster0-shard-00-00-dwqdx.mongodb.net:27017, cluster0-shard-00-01-dwqdx.mongodb.net:27017, cluster0-shard-00-02-dwqdx.mongodb.net:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='Cluster0-shard-0'}
May 28, 2020 6:36:50 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Adding discovered server cluster0-shard-00-00-dwqdx.mongodb.net:27017 to client view of cluster
May 28, 2020 6:36:50 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Adding discovered server cluster0-shard-00-01-dwqdx.mongodb.net:27017 to client view of cluster
May 28, 2020 6:36:50 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Adding discovered server cluster0-shard-00-02-dwqdx.mongodb.net:27017 to client view of cluster
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(LauncherImpl.java:182)
at com.sun.javafx.application.LauncherImpl$$Lambda$50/683287027.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@6617d7e2. Client view of cluster state is {type=REPLICA_SET, servers=[{address=cluster0-shard-00-01-dwqdx.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 3.6.181.176 found}, caused by {java.security.cert.CertificateException: No subject alternative names matching IP address 3.6.181.176 found}}, {address=cluster0-shard-00-00-dwqdx.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 3.7.19.65 found}, caused by {java.security.cert.CertificateException: No subject alternative names matching IP address 3.7.19.65 found}}, {address=cluster0-shard-00-02-dwqdx.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 3.6.213.55 found}, caused by {java.security.cert.CertificateException: No subject alternative names matching IP address 3.6.213.55 found}}]
at com.mongodb.internal.connection.BaseCluster.createTimeoutException(BaseCluster.java:401)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:120)
at com.mongodb.internal.connection.MultiServerCluster.selectServer(MultiServerCluster.java:54)
at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:138)
at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:94)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:249)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:172)
at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:132)
at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:86)
at com.mongodb.client.internal.MongoIterableImpl.forEach(MongoIterableImpl.java:110)
at ConnectToDb.loadFromAFileImpl(ConnectToDb.java:64)
at Main.loadFromAFile(Main.java:99)
at Main.start(Main.java:82)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
at com.sun.javafx.application.LauncherImpl$$Lambda$53/350855150.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/2027961269.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/1735436626.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/1642360923.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/1535128843.run(Unknown Source)
... 1 more
Exception running application Main
我是Java的初学者。我正在尝试开发一个小型Java + JavaFX应用程序,并且在尝试连接到MongoDB云时遇到了此错误。预先谢谢你。