'Couldn't find PersistentEntity for type class' exception in Spring boot MongoRepository
问题 In here I have configured two databases in mongodb. As described in this tutorial (link). So basically I override the MongoDataAutoConfiguration and MongoProperties implementations. The property yml file : spring: autoconfigure: exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration mongodb: primary: host: 127.0.0.1 port: 27017 database: db_admin_crm secondary: host: 127.0.0.1 port: 27017 database: lead_forms MultipleMongoProperties class : @Data @ConfigurationProperties