Spring Failed to convert property value of type ' java.lang.String ' to required type ' int ' for proper

Source: Internet
Author: User

In this case, it looks like spring's

Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

Class has a problem reading the information, and the String value is treated as an int type.

In fact, this is not the case, the problem is that the configuration file location configuration error, Spring did not find the configuration file, so it is an error, but the mistake does not make the problem clear.

Check that your profile location is configured correctly, and below is how the configuration file is configured

<!--introducing cached configuration file properties--> <bean class= "Org.springframework.beans.factory.config.PropertyPlaceholde Rconfigurer "> <property name=" ignoreresourcenotfound value= "true"/> <property name= "ignoreUn
                Resolvableplaceholders "value=" true "/> <property name=" Locations "> <list>
                <!--This location is relative to: after the deployed project Root path--> <!--<value>/WEB-INF/cache.properties</value>--> <!--This location is relative to: file directly under the SRC directory--> <!--<value>classpath*:cache.properties</va Lue>--> <!--This location is relative to: The file is--> <!--<value>classpath*:cache/cache under the directory.
                Properties</value>--> <value>classpath*:/cache/cache.properties</value> <!--This location is to look for values in the server environment variable named: XXX (for example: file:d:/test/test.properties)--> <!--&LT;VALUE&GT;${XXX}&L
    T;/value>-->            <!--This location is relative to: File system--> <!--<value>file:D:/test/test.properties</value>--

 > </list> </property> </bean>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.