stepheboii Posted November 19, 2022 Share Posted November 19, 2022 Hello,I'm attempting to access a MongoDB with Jasper Report (6.20.0).I entered the following URI into the database: mongodb:/cluster0.y09dxf4.mongodb.net:27017/sample analyticsThe setting is one of the online MongoDb samples.The error information are as follows:net.sf.jasperreports.engine.JRCannot test MongoDB connection due to exception: Error establishing MongoDBConnection; Timed out after 30000 ms when connecting was the cause. Client view of cluster state has the following properties: type=UNKNOWN, servers=[address=cluster0.y09dxf4.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception=com.mongodb.MongoSocketException: cluster0.y09dxf4.mongodb.net, triggered by java.net.UnknownHostException: cluster0.y09dxf4.mon com.jaspersoft.mongodb.adapter's MongoDbConnection. (MongoDbConnection.java:86) method. In com.jaspersoft.mongodb.adapter, call MongoDbDataAdapterService.createConnection(MongoDbDataAdapterService.java:70). MongoDbDataAdapterService.test at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard (MongoDbDataAdapterService.java:91) At the com.jaspersoft.studio.utils.jobs $3.runOperations(AbstractDataAdapterWizard.java:154) function. Checked @ java.base/java.lang, RunnableWithProgress$1.run(CheckedRunnableWithProgress.java:51). Thread.run(Unknown Source) (Unknown Source)Net.sf.JasperReports.Engine.JR is the root causeCannot test MongoDB connection due to timed out after 30000 milliseconds of waiting. Client view of cluster state has the following properties: type=UNKNOWN, servers=[address=cluster0.y09dxf4.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception=com.mongodb.MongoSocketException: cluster0.y09dxf4.mongodb.net, triggered by java.net.UnknownHostException: cluster0.y09dxf4.mon com.jaspersoft.mongodb.connection, MongoDbConnection.test (MongoDbConnection.java:192). MongoDbConnection. (MongoDbConnection.java:82)... 6 more Link to comment Share on other sites More sharing options...
Anuja Vilas Bhujbal Posted February 10, 2023 Share Posted February 10, 2023 Hello, Try connecting to a single node in the MongoDB mainly the primary node in the cluster instead of connecting to the cluster URL. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now