giovanni.chiozza_1 Posted October 9, 2022 Posted October 9, 2022 Hello,I'm trying to connect to a MongoDB to Jassper Report (6.20.0).This is what I wrote into URI : mongodb://cluster0.y09dxf4.mongodb.net:27017/sample_analyticsThe environment is that one of MongoDb samples on webThis is the error details :net.sf.jasperreports.engine.JRException: Error creating MongoDBConnection; Caused by: Cannot test MongoDB connection; Caused by: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=cluster0.y09dxf4.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: cluster0.y09dxf4.mongodb.net}, caused by {java.net.UnknownHostException: cluster0.y09dxf4.mongodb.net}}] at com.jaspersoft.mongodb.connection.MongoDbConnection.<init>(MongoDbConnection.java:86) at com.jaspersoft.mongodb.adapter.MongoDbDataAdapterService.createConnection(MongoDbDataAdapterService.java:70) at com.jaspersoft.mongodb.adapter.MongoDbDataAdapterService.test(MongoDbDataAdapterService.java:91) at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.runOperations(AbstractDataAdapterWizard.java:154) at com.jaspersoft.studio.utils.jobs.CheckedRunnableWithProgress$1.run(CheckedRunnableWithProgress.java:51) at java.base/java.lang.Thread.run(Unknown Source)Caused by: net.sf.jasperreports.engine.JRException: Cannot test MongoDB connection; Caused by: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=cluster0.y09dxf4.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: cluster0.y09dxf4.mongodb.net}, caused by {java.net.UnknownHostException: cluster0.y09dxf4.mongodb.net}}] at com.jaspersoft.mongodb.connection.MongoDbConnection.test(MongoDbConnection.java:192) at com.jaspersoft.mongodb.connection.MongoDbConnection.<init>(MongoDbConnection.java:82) ... 5 moreCaused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=cluster0.y09dxf4.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: cluster0.y09dxf4.mongodb.net}, caused by {java.net.UnknownHostException: cluster0.y09dxf4.mongodb.net}}] at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:182) at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:41) at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:136) 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.MongoDatabaseImpl.executeCommand(MongoDatabaseImpl.java:184) at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:153) at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:148) at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:138) at com.jaspersoft.mongodb.connection.MongoDbConnection.test(MongoDbConnection.java:187) ... 6 more
vchiem Posted October 12, 2022 Posted October 12, 2022 Maybe this can help :https://community.jaspersoft.com/questions/1111616/unable-connect-remote-mongodb-data-sourceFurther you can test in Studio with the test button to test the URL. This is step 2. https://community.jaspersoft.com/wiki/mongodb-japserstudio-connection
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