Reputation: 7196
I have declared db url
, db user
and db password
in application.properties
like this
spring.datasource.url=${SPRING_DB_URL}
spring.datasource.username=${SPRING_DB_USER}
spring.datasource.password=${SPRING_DB_PASS}
This works in Ubuntu 16.04 but it is not working in windows 7, and the web application is not starting and in logs, it is showing,
Driver com.microsoft.sqlserver.jdbc.SqlServerDriver claims not to accept jdbcurl, ${SPRING_DB_URL}
I tried setting the environment variable with key like this,
spring_datasource_url
but that too is not working.
the app is build as war
file
Why this works in Ubuntu but not in Windows 7?
Upvotes: 2
Views: 3198
Reputation: 40048
From Externalized Configuration So use the key in upper case letters with combination of underscore if needed
If you use environment variables rather than system properties, most operating systems disallow period-separated key names, but you can use underscores instead (for example,
SPRING_CONFIG_NAME
instead ofspring.config.name
).
Upvotes: 1