Category: | Bug report |
Priority: | Immediate |
Status: | New |
Project: | Severity: | Block |
Resolution: | Open |
|
Component: | Reproducibility: | Always |
Assigned to: |
in JasperReports Server 6.1, when trying to connect to a mongodb server on version 3.X with disabled MONGODB-CR authentification, JasperReports Server can not connect, giving the error message:
net.sf.jasperreports.engine.JRException: Successful connection but wrong authentication
The respective mongodb log shows that JasperReports Server is trying to connect via the method "MONGODB-CR", which is deprecated (https://jira.mongodb.org/browse/SERVER-17459):
2015-06-26T09:32:35.864+0000 I ACCESS [conn79] Failed to authenticate XXX@YYY with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document
Solution: when connecting to a mongodb server on version 3.X, the method "SCRAM-SHA1" should be used.
v6.1
5 Comments:
mongodb://user:pass@IP/admin?authMechanism=SCRAM-SHA-1 gives
"Unsupported authMechanism: SCRAM-SHA-1"
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:162)
at com.jaspersoft.studio.utils.jobs.CheckedRunnableWithProgress$1.run(CheckedRunnableWithProgress.java:59)
at java.lang.Thread.run(Unknown Source)
thanks for this information.
You can hack it by replacing jar file:
"JaspersoftStudio-6.1.0\jaspersoftstudio\configuration\org.eclipse.osgi\bundles\29\1\.cp\lib\mongo-java-driver-2.12.3.jar"
use https://github.com/mongodb/mongo-java-driver/releases/download/r2.13.2/m...
for JasperSoft studio Eclipse you have to reame mongo-java-driver-2.13.2.jar to mongo-java-driver-2.12.3.jar
for Jaspersoft server it works without renaming
then, to have it working you need to pass username/password in the URI (don't use u/p fields as they won't work)
also put your user in the db as it seem not to work happily for admin database
works for cluster as well
ie: mongodb://{user}:{password}@{host1},{host2},{host3}/{dbname}?replicaSet={replset_name}
I am having the same problem. I am trying to connect to a MongoDb 3.0 with wired tiger and authentication.
I tried the solution of replacing the driver file https://github.com/mongodb/mongo-java-driver/releases/download/r2.13.2/m...
but it didn't work. Any help you can provide is greatly appreciated.
regards,
Yogesh Gaur