metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Sørensen <i.am.kasper.soren...@gmail.com>
Subject Re: Exception on MongoDB
Date Sat, 07 Mar 2015 18:46:55 GMT
Hi Anders,

Thank you for the notice! Yes we should upgrade the dependency to make sure
we use best practices as prescribed by the MongoDB guys. For a short term
fix I suggest that you use the constructor way of instantiating the
datacontext. That should allow you to do the DB authentication yourself:

DB db = ...;
new MongoDbDataContext(db);

Best regards,
Kasper

2015-03-06 0:28 GMT+01:00 Anders Nilsson Plymoth <anders@telhoc.se>:

> Hi,
>
> I am just starting using MetaModel, and I am trying to connect to a
> MongoDB 3.0.0 DB.
>
> UpdateableDataContext dataContext =
> DataContextFactory.createMongoDbDataContext("dude.myserver.com",
> 27017, "mydb", "mongodb", null);
>
> Output:
> Mar 06, 2015 12:05:45 AM com.mongodb.diagnostics.logging.JULLogger log
> INFO: Cluster created with settings {hosts=[dude.myserver.com:27017],
> mode=SINGLE, requiredClusterType=UNKNOWN,
> serverSelectionTimeout='30000 ms', maxWaitQueueSize=50}
> Exception in thread "main" java.lang.NoSuchMethodError:
> com.mongodb.DB.authenticate(Ljava/lang/String;[C)Z
>     at
> org.apache.metamodel.DataContextFactory.createMongoDbDataContext(DataContextFactory.java:545)
>     at
> org.apache.metamodel.DataContextFactory.createMongoDbDataContext(DataContextFactory.java:578)
>
> The issue seems to be that MetaModel uses the deprecated
> DB.authenticate method that was removed in MongoDB 3.0. Looks like
> DataContextFactory needs to be rewritten.
>
> Thanks,
> Anders
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message