Spring-boot @Value binding Issue -


facing weird issue spring-boot property-resolver.

trying simple @value 1 of properties. in debug log, see property being matched,, reporting unable find few lines later. idea on what's going wrong?

java code:

@configuration public class testappconfig{      @value("${appname}")     private string applicationname; } 

log below

10 jun 2015 18:41:42 org.springframework.core.env.propertysourcespropertyresolver debug {searching key 'appname' in [applicationconfig: [classpath:/config/application-dev.yml]]} 10 jun 2015 18:41:42 org.springframework.core.env.propertysourcespropertyresolver debug {searching key 'appname' in [applicationconfig: [classpath:/config/application.yml]]} 10 jun 2015 18:41:42 org.springframework.core.env.propertysourcespropertyresolver debug {found key 'appname' in [applicationconfig: [classpath:/config/application.yml]] type [string] , value 'testapp'}  caused by: java.lang.illegalargumentexception: not resolve placeholder 'appname' in string value "${appname}" 

i guessing deployed app war inside web container need confirm. need add method below class. @ related posting

@bean public static propertysourcesplaceholderconfigurer propertyplaceholderconfigurer() {     return new propertysourcesplaceholderconfigurer(); } 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -