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
Post a Comment