[JAVA-3648] Legacy driver 3.12.2 does not work alongside mongodb-driver-reactivestreams 4.0.0 Created: 06/Mar/20  Updated: 27/Oct/23  Resolved: 06/Mar/20

Status: Closed
Project: Java Driver
Component/s: Reactive Streams
Affects Version/s: 3.12.2, 4.0.0
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Siqi Li Assignee: Jeffrey Yemin
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When I import both mongo-java-driver 3.12.2 and mongodb-driver-reactivestreams 4.0.0 into my project, simply calling this:

MongoClientOptions.builder().build();

will cause this exception:

Exception in thread "main" java.lang.NoSuchMethodError: com.mongodb.connection.ConnectionPoolSettings$Builder.maxWaitQueueSize(I)Lcom/mongodb/connection/ConnectionPoolSettings$Builder; 
at com.mongodb.MongoClientOptions.<init>(MongoClientOptions.java:157) 
at com.mongodb.MongoClientOptions.<init>(MongoClientOptions.java:58) 
at com.mongodb.MongoClientOptions$Builder.build(MongoClientOptions.java:1734)

I'm only really using the reactivestreams driver, but there's a 3rd party library I'm using that uses the legacy driver. It would be nice to at least be able to import both libraries.

 



 Comments   
Comment by Justin Lee [ 07/Mar/20 ]

@Siqi li, there is a beta of the upcoming 2.0.0 release of morphia if you would like to give it a spin.  The docs are lagging behind slightly but i'm currently working on getting those updated.

Comment by Siqi Li [ 06/Mar/20 ]

OK I think it's safe to close this issue.

Comment by Jeffrey Yemin [ 06/Mar/20 ]

I know Morphia is working on its own major release that uses the 4.0 driver. It should be coming soon.

CC jlee@antwerkz.com

Comment by Siqi Li [ 06/Mar/20 ]

It's [Morphia|https://morphia.dev/ [].|http://example.com]./] We used to use Morphia for everything, but then we switched to the reactivestreams driver and we only use Morphia to do object mapping stuff.

Comment by Jeffrey Yemin [ 06/Mar/20 ]

It's not possible to do this.  As a major release of the driver, there were backwards-breaking changes that make the two versions incompatible.  You're going to have to make sure that all your dependent libraries are also updated.  Can you provide the name of the 3rd party library?  Perhaps we can work with them to get it upgraded to 4.0.

 

Generated at Thu Feb 08 09:00:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.