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

Connect to MongoDB With Authentication


lukus
Go to solution Solved by lukus,

Recommended Posts

 Hi There,

I want to connect to a MongoDB that has authentication enabled on it.  It seems that iReport does not support this (seems very strange that this is the case).  I'm wondering if there is some sort of work around.  I would be happy to write a class that returns the fully authenticated connection but I need to know if/how I could impliment this from within iReport.

Anyone got any tips or workarouds on how to get my mongodb playing nicely with iReport?

Cheers

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi there,

I'm running a mongodb on amazon with authenticartion at a db level (not server level).

I'm running iReport Designer 4.7.0 with the MongoDbPlugin 0.14.  When I ht the test button after setting up the "MongoDB Connection" I get a "...JRException: unauthorized"

I've been using iReport for a long time but have been forced to use a different (far inferiorior product) while I sort this out/wait for a change.  I'm hoping this is all down to my own stupidity!

 

Cheers

Luke

Link to comment
Share on other sites

  • 7 months later...

Hi,

 

If the mongodb connector works well with authentication, what are the steps that needed to get it to work? We are facing similar problems.
We are running JasperReports 5.1 on JBoss 7.
 
When we try to setup a datasource to mongo it always fails. From what I can see, the jasper server does not even try to authentication, even if username and password are specified.
 
The jboss log shows the following.
10:24:58,467 ERROR [com.jaspersoft.jasperserver.war.action.DataSourceAction] (http--0.0.0.0-8080-1) exception testing custom data source: net.sf.jasperreports.engine.JRException: not authorized for query on myLogging.system.namespaces

 

at com.jaspersoft.mongodb.jasperserver.MongoDbDataSourceService.createConnection(MongoDbDataSourceService.java:98) [js-mongodb-datasource-1.0.0.jar:]
at com.jaspersoft.mongodb.jasperserver.MongoDbDataSourceService.testConnection(MongoDbDataSourceService.java:105) [js-mongodb-datasource-1.0.0.jar:]
at com.jaspersoft.jasperserver.war.action.DataSourceAction.testCustomDataSource(DataSourceAction.java:411) [jasperserver-war-jar-5.1.0.jar:]
 
 
In the mongs router log I see the following.
Fri May 17 06:24:49.969 [mongosMain] connection accepted from 10.6.166.128:51475 #490 (27 connections now open)
But that's about it. There is not try to authenticate. Which make the error in the jboss log logical, because it's not authorized to do anything without being authenticated.
 
Is this maybe a bug in 5.1?
 
Thanks
Marco
 
 
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

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...