MongoDB java 3.3.0 + spring boot 1.4.1 error

1,584 views
Skip to first unread message

Pradeep Singh

unread,
Sep 23, 2016, 10:17:23 AM9/23/16
to mongodb-user
I am trying to use Mongodb java 3.3.0 driver and seeing below error 


java.lang.NoSuchMethodError: org.bson.codecs.BsonTypeClassMap.keys()Ljava/util/Set; at org.bson.codecs.BsonTypeCodecMap.<init>(BsonTypeCodecMap.java:41) at com.mongodb.DBObjectCodec.<init>(DBObjectCodec.java:117) at com.mongodb.DBObjectCodec.<init>(DBObjectCodec.java:104) at com.mongodb.DBObjectCodec.<init>(DBObjectCodec.java:94) at com.mongodb.MongoClient.getCommandCodec(MongoClient.java:358) at com.mongodb.DB.<init>(DB.java:86) at com.mongodb.Mongo.getDB(Mongo.java:481) at org.springframework.data.mongodb.core.MongoDbUtils.doGetDB(MongoDbUtils.java:124) at 



any help would be highly appreciated.



Jeff Yemin

unread,
Sep 23, 2016, 10:23:37 AM9/23/16
to mongodb-user
Hi Pradeep,

Can you post your effective class path?  It looks like you're loading the BsonTypeClassMap class from an earlier version of the bson library, as the missing method was added in 3.3.0.


Regards,
Jeff
Message has been deleted

Pradeep Singh

unread,
Sep 23, 2016, 12:28:08 PM9/23/16
to mongodb-user
Here is mongo libraries in class path


--- org.springframework.boot:spring-boot-starter-data-mongodb:1.2.5.RELEASE -> 1.4.0.RELEASE
525: | | +--- org.springframework.boot:spring-boot-starter:1.4.0.RELEASE ()
526: | | +--- org.mongodb:mongodb-driver:3.2.2
527: | | | +--- org.mongodb:mongodb-driver-core:3.2.2
528: | | | | --- org.mongodb:bson:3.2.2
529: | | | --- org.mongodb:bson:3.2.2
530: | | --- org.springframework.data:spring-data-mongodb:1.9.2.RELEASE (
)

Pradeep Singh

unread,
Sep 23, 2016, 1:00:57 PM9/23/16
to mongodb-user
Thanks for help. Found the root cause. 3.2.2 was loading from other dependencies and caused failures.

bigghe144

unread,
Nov 21, 2016, 3:08:25 PM11/21/16
to mongodb-user
Hi, I have the same problem;
can you explain me how did you resolve?
Thanks :)

18335...@163.com

unread,
Nov 27, 2016, 10:31:19 PM11/27/16
to mongodb-user
Hi, I hava the same problem,too;
  Did you solve your problem?
  Thanks

在 2016年11月22日星期二 UTC+8上午4:08:25,bigghe144写道:
Reply all
Reply to author
Forward
0 new messages