配置文件
spring.shardingsphere.datasource.names=master_db,slave_db
错误提示
Caused by: org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException: Configuration property name 'spring.shardingsphere.datasource.master_db' is not valid
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:579)
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:556)
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:547)
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:524)
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:199)
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:186)
... 100 more
原因:
配置文件中的key不能带下划线,value可以