Spring @Value TypeMismatchException:Failed to convert value of type ‘java.lang.String’ to required type ‘java.lang.Double’
Try changing the following line @Value(“${item.priceFactor}”) to @Value(“#{new Double(‘${item.priceFactor}’)}”)
Try changing the following line @Value(“${item.priceFactor}”) to @Value(“#{new Double(‘${item.priceFactor}’)}”)
Assuming you have a properties file on your classpath that contains api.orders.pingFrequency=4 I tried inside a @Controller @Controller public class MyController { @Value(“${api.orders.pingFrequency}”) private Integer pingFrequency; … } With my servlet context containing : <context:property-placeholder location=”classpath:myprops.properties” /> It worked perfectly. So either your property is not an integer type, you don’t have the property placeholder … Read more