How to transfer git repositories from GitLab to GitHub?
Issue: multiply properties configs on Spring
Andriy AndrunevchynSpent some time to figure out why i cannot add properties on app context.
Config was pretty trivial
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="properties" ref="configproperties" /> </bean> <bean id="configproperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>classpath:/properties/common.properties</value> </list> </property> </bean>
so 2 hours lost and I figured out there is no issue with this part of config I just didn’t notice one line on top
<context:property-placeholder location="classpath:old.properties" />
Definitely you cannot mix two approaches. The worst thing is you will not see any exception or warning just binding will not work
@Value(value = "${propname}") private String property; //throw exception runtime
Comments
0
There are currently no comments.