一、錯誤描述
Description:
Failed to bind properties under 'eureka.client.service-url' to java.util.Map<java.lang.String, java.lang.String>:
Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.String>]
Action:
Update your application's configuration
二、問題分析
遵循原則:哪報錯找哪
報錯信息
No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.String>]
不能將service-url從String類型轉換爲Map類型的
三、解決辦法
打開application.yml配置文件,在defaultZone:後加空格
如果不加空格
- defaultZone: http://127.0.0.1:${server.port}/eureka/
- 整體是一個String類型
加上空格後
- defaultZone 爲key
- http://127.0.0.1:${server.port}/eureka/爲value
- 整體是一個Map類型