Jump to content
We've recently updated our Privacy Statement, available here ×

How create Data adapter with MONGODB


giovanni.chiozza_1

Recommended Posts

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_analytics

The environment is that one of MongoDb samples on web

This 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 more
Caused 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
 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...