java - Spring @Value Could not resolve placeholder in string value -


have context spring conf this, have 2 property-placeholder in context.

<?xml version="1.0" encoding="utf-8"?> <beans>     <context:annotation-config/>     <context:component-scan base-package="com.xxx.app.xxx"/>      <context:property-placeholder location="classpath:em-management.properties"/>     <context:property-placeholder location="file:///opt/ass/swp/conf/platform.properties"/>  </beans> 

when run code, met error:

 org.springframework.beans.factory.beancreationexception: error creating bean name 'cmclient': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private java.lang.string com.xxxx.app.xxxx.xx.client.cmclient.washost; nested exception java.lang.illegalargumentexception: not resolve placeholder 'com.ibm.corba.securityserverhost' in string value "${com.ibm.corba.securityserverhost}"  caused by: org.springframework.beans.factory.beancreationexception: not autowire field: private java.lang.string com.xxxx.app.xxx.xxx.client.cmclient.washost; nested exception java.lang.illegalargumentexception: not resolve placeholder 'com.ibm.corba.securityserverhost' in string value "${com.ibm.corba.securityserverhost}"  caused by: java.lang.illegalargumentexception: not resolve placeholder 'com.ibm.corba.securityserverhost' in string value "${com.ibm.corba.securityserverhost}" 

how solve issue?

i found solution particular problem,just append ignore-unresolvable="true" each line.

<context:property-placeholder location="classpath:em-management.properties" ignore-unresolvable="true"/> <context:property-placeholder location="file:///opt/ass/swp/conf/platform.properties" ignore-unresolvable="true"/> 

Comments