I have a properties file test.properties
HOST = http://localhost
PORT = 1234
In my config file I am passing the values from the properties file to a bean constructor-arg.
<util:properties id="nodeProperty"
location="classpath:config/test.properties" />
<context:property-placeholder
properties-ref="nodeProperty" />
<bean id="client" class="com.abc.client.ReadWrite">
<constructor-arg value="${HOST}" index="0"/>
<constructor-arg value="${PORT}" index="1" type="int"/>
</bean>
When I run this I get the following error
Unsatisfied dependency expressed through constructor argument with index 1 of type
[int]: Could not convert constructor argument value of type [java.lang.String] to
required type [int]: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "8002;"