我正在尝试将 Jaspersoft Studio 6.2.0 连接到 MongoLab 上托管的 MongoDB 数据库(mongod 版本:3.0.7)。
使用连接 URI:
mongodb://ds012345-a0.mongolab.com:12345,ds012345-a1.mongolab.com:12345/mydb?replicaSet=rs-ds012345
测试适配器时出现以下异常:
net.sf.jasperreports.engine.JRException: com.mongodb.CommandFailureException: { "serverUsed" : "ds012345-a0.mongolab.com:12345" , "ok" : 0.0 , "errmsg" : "auth failed" , "code" : 18}
at com.jaspersoft.mongodb.connection.MongoDbConnection.test(MongoDbConnection.java:162)
at com.jaspersoft.mongodb.adapter.MongoDbDataAdapterService.test(MongoDbDataAdapterService.java:93)
at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.runOperations(AbstractDataAdapterWizard.java:162)
at com.jaspersoft.studio.utils.jobs.CheckedRunnableWithProgress$1.run(CheckedRunnableWithProgress.java:59)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.mongodb.CommandFailureException: { "serverUsed" : "ds012345-a0.mongolab.com:12345" , "ok" : 0.0 , "errmsg" : "auth failed" , "code" : 18}
at com.mongodb.CommandResult.getException(CommandResult.java:76)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:131)
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:652)
at com.mongodb.DBPort.authenticate(DBPort.java:364)
at com.mongodb.DBPort.checkAuth(DBPort.java:375)
at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:291)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:271)
at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:84)
at com.mongodb.DB.command(DB.java:317)
at com.mongodb.DB.command(DB.java:296)
at com.mongodb.DB.command(DB.java:371)
at com.mongodb.DB.command(DB.java:243)
at com.mongodb.DB.command(DB.java:397)
at com.jaspersoft.mongodb.connection.MongoDbConnection.test(MongoDbConnection.java:158)
... 4 more