edp963 / davinci

Davinci is a DVsaaS (Data Visualization as a Service) Platform
https://edp963.github.io/davinci
Apache License 2.0
4.89k stars 1.82k forks source link

server 运行出错 #436

Closed striveye closed 6 years ago

striveye commented 6 years ago

Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"

image

这是配置文件的路径错了吗,应该怎么配置

RichardShan commented 6 years ago
  1. 确认已经配置了环境变量(DAVINCI3_HOME)
  2. 请确保application.yml中每个配置项与值之间至少有一个空格
  3. 如果是windows环境,请确保启动脚本或命令引入了配置文件,即--spring.config.additional-location=file:%DAVINCI3_HOME%\config\application.yml
striveye commented 6 years ago

加上 --spring.config.additional-location=file:%DAVINCI3_HOME%\config\application.yml 之后确实可以, 但是这样的话在 server 目录下的 application.yml 文件中配置 spring.config.location 还有什么意义,而且只在这里配好像没起作用

RichardShan commented 6 years ago

单独新建了工程测试了一下,windows系统下springboot以jar包的方式运行,通过配置加载外部配置文件不会生效,目前只能按照这种方式去加载外部配置了

striveye commented 6 years ago

好的,谢谢