淘先锋技术网

首页 1 2 3 4 5 6 7
错误代码:
Caused by: java.lang.IllegalStateException: Invalid mongo configuration, either uri or host/port/credentials must be specified

使用application.properties配置如下:

spring.data.mongo.host=127.0.0.1
spring.data.mongo.port=27017
spring.data.mongo.username=***
spring.data.mongo.password=***
spring.data.mongo.database=***

需要改成
spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.port=27017
spring.data.mongodb.username=***
spring.data.mongodb.password=***
spring.data.mongodb.database=***
mongodb安装的版本是3.2.10
如果配置
spring.data.mongodb.uri=mongodb://***:[email protected]:27017/***
启动会报错 Invalid mongo configuration, either uri or host/port/credentials must be specified
还没找到解决办法,有谁知道,指教一下