Problem : Exception in thread "main" org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.time.LocalDate. org.bson.codecs.configuration.CodecConfigurationException: Unable to get value for property Solution : Try creating your bean by this way to help POJO classes. @Bean public MongoDatabase mongoDatabase () { try { CodecRegistry pojoCodecRegistry = fromRegistries(MongoClient. getDefaultCodecRegistry (), fromProviders(PojoCodecProvider. builder (). automatic ( true ). build ())); String connectionString = "mongodb+srv://" + username + ":" + password + "@" + host + "/" + database + "" ; log. info ( "Connection String " + connectionString); MongoClientURI uri = new MongoClientURI(connectionString); MongoClient mongoClient = new MongoClient(uri); ...
A Full Stack developer who is facing problems in development cycle and here you find solution of errors of those problems.This includes all exception and configuration issues. Solutions which i have written in blog are the one which worked for me after killing my time :) .