application.properties: spring.data.mongodb.uri=mongodb://localhost:27017/MongoDBandJpaDemo 但是仅仅是设置这个的话还会报错: 解决办法: