From 7ef20c4d5e823c2ba1e7867492fc5a437bce2b4a Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Fri, 10 May 2013 14:38:51 +0700 Subject: [PATCH 1/3] back to 5.1.1-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6e34bcb..819602b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ com.jaspersoft.studio.data.mongodb jar - 5.1.0.soluvas1 + 5.1.1-SNAPSHOT From 0da370e8515b58156de910ef4e4ccc2af95ef26b Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Fri, 10 May 2013 15:43:54 +0700 Subject: [PATCH 2/3] bippo-gk profile --- pom.xml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 819602b..b20f4eb 100644 --- a/pom.xml +++ b/pom.xml @@ -107,5 +107,23 @@ http://nexus.bippo.co.id/nexus/content/repositories/soluvas-public-snapshots/ - + + + + + bippo-gk + + + bippo-gk-snapshots + http://192.168.44.17:8080/nexus/content/repositories/snapshots/ + + + bippo-gk-releases + http://192.168.44.17:8080/nexus/content/repositories/releases/ + + + + + From 065a33b3391e1be8ea943d55c9ff02e02ca6aa3d Mon Sep 17 00:00:00 2001 From: Rudi Wijaya Date: Mon, 28 Apr 2014 07:09:17 -0430 Subject: [PATCH 3/3] MongoDB 2.6.0 fix --- context.xml | 26 +++++++++---------- .../mongodb/connection/MongoDbConnection.java | 23 +++++++++------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/context.xml b/context.xml index 17ef068..00e6566 100644 --- a/context.xml +++ b/context.xml @@ -1,14 +1,14 @@ - - - - - - MongoDB is an open source document-oriented database system developed and supported by 10gen. It is part of the NoSQL family of database systems. Instead of storing data in tables as is done in a "classical" relational database, MongoDB stores structured data as JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster. - - - - From this dialog you can change the dataset query, define new parameters or change the adapter used to retrive the data. - - + + + + + + MongoDB is an open source document-oriented database system developed and supported by 10gen. It is part of the NoSQL family of database systems. Instead of storing data in tables as is done in a "classical" relational database, MongoDB stores structured data as JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster. + - + + From this dialog you can change the dataset query, define new parameters or change the adapter used to retrive the data. + + + + diff --git a/src/com/jaspersoft/mongodb/connection/MongoDbConnection.java b/src/com/jaspersoft/mongodb/connection/MongoDbConnection.java index 6bfa777..ba427ac 100644 --- a/src/com/jaspersoft/mongodb/connection/MongoDbConnection.java +++ b/src/com/jaspersoft/mongodb/connection/MongoDbConnection.java @@ -31,9 +31,10 @@ import java.sql.Statement; import java.sql.Struct; import java.util.Arrays; -import java.util.List; +import java.util.HashSet; import java.util.Map; import java.util.Properties; +import java.util.Set; import java.util.concurrent.Executor; import net.sf.jasperreports.engine.JRException; @@ -66,11 +67,12 @@ public class MongoDbConnection implements Connection { private static final Logger logger = LoggerFactory.getLogger(MongoDbConnection.class); - protected static final List AUTH_ERROR_CODES = Arrays.asList(new Integer[] { + protected static final Set AUTH_ERROR_CODES = new HashSet(Arrays.asList(new Integer[] { 16550, // not authorized for query on foo.system.namespaces 10057, // unauthorized db:admin ns:admin.system.users lock type:1 client:127.0.0.1 - 15845 // unauthorized - }); + 15845, // unauthorized + 13 // MongoDB 2.6.0: not authorized on DB to execute command { count: \"system.namespaces\", query: {}, fields: {} } + })); public MongoDbConnection(String mongoURI, String username, String password) throws JRException { @@ -86,7 +88,7 @@ private void create(String mongoURI) throws JRException { client = new Mongo(mongoURIObject = new MongoURI(mongoURI)); } catch (Exception e) { logger.error("Cannot create connection", e); - throw new JRException(e.getMessage()); + throw new JRException(e.getMessage(), e); } } @@ -105,15 +107,16 @@ private void setDatabase() throws JRException { } catch (Exception e) { String message = e.getMessage(); if (e instanceof MongoException) { - if (AUTH_ERROR_CODES.contains(((MongoException) e).getCode())) { + final MongoException mongoE = (MongoException) e; + if (AUTH_ERROR_CODES.contains(mongoE.getCode())) { performaAuthentication = true; } else { - logger.error("Cannot set database", e); - throw new JRException(message); + logger.error("Cannot set database. Code " + mongoE.getCode() + ": " + mongoE, mongoE); + throw new JRException("Error " + mongoE.getCode() + ": " + mongoE, mongoE); } } else { - logger.error("Cannot set database", e); - throw new JRException(message); + logger.error("Cannot set database: " + e, e); + throw new JRException(message, e); } } if (performaAuthentication) {