MongoDB Scala client- java.lang.NoSuchMethodError: com.mongodb.MongoClientSettings.getUuidRepresentation()Lorg/bson/UuidRepresentation;

Viewed 562

I am trying to use the Mongo scala client, but when I init the client I get the following exception:

java.lang.NoSuchMethodError: com.mongodb.MongoClientSettings.getUuidRepresentation()Lorg/bson/UuidRepresentation;

In my project, I also use Mongo java client for other purposes.

I saw this question and solution so I guess it is probably the same issue (libraries conflicts).

The problem is that I prefer to keep the design of 2 clients- one java and one scala (BTW, each client is for a different Mongo cluster).

I wonder how can I achieve that.

build.sbt:

"org.mongodb" % "mongo-java-driver" % "3.11.1",
"org.mongodb.scala" %% "mongo-scala-driver" % "2.9.0",

code:

val mongoClient: MongoClient = org.mongodb.scala.MongoClient(server)

Thanks a lot

1 Answers

Seems like there is no solution for having 2 clients. Eventually, I used one java client :(

Related