Factory method ‘mongoClient’ threw exception; nested exception is java.lang.NoSuchFieldError: UNSPECIFIED

Getting following error while deploying application

java.lang.NoSuchFieldError: UNSPECIFIED at com.mongodb.MongoClientSettings$Builder.(MongoClientSettings.java:168) ~[mongodb-driver-core-4.4.2.jar!/:?] at com.mongodb.MongoClientSettings$Builder.(MongoClientSettings.java:150) ~[mongodb-driver-core-4.4.2.jar!/:?] at com.mongodb.MongoClientSettings.builder(MongoClientSettings.java:132) ~[mongodb-driver-core-4.4.2.jar!/:?] . . . Wrapped by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method ‘mongoClient’ threw exception; nested exception is java.lang.NoSuchFieldError: UNSPECIFIED . . . Wrapped by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘’ defined in class path resource [com/abcv/www/cvvc/api/mongo/config/Andsdsn.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method ‘mongoClient’ threw exception; nested exception is java.lang.NoSuchFieldError: UNSPECIFIED

2 Likes