spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper
2015-05-07 17:35
429 查看
这种情况,看起来好像是 spring 的
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
类在读取信息的时候出问题了,把 String 类型的值当成了 int 类型的了
实际上这并不是这么回事,问题在于配置文件的位置配置错误,spring 根本没有找到那个配置文件,所以它报错了,只不过这个错误没有把问题说明白。
好好检查你的 配置文件位置是不是配置的正确,下面是配置文件的配置方式
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
类在读取信息的时候出问题了,把 String 类型的值当成了 int 类型的了
实际上这并不是这么回事,问题在于配置文件的位置配置错误,spring 根本没有找到那个配置文件,所以它报错了,只不过这个错误没有把问题说明白。
好好检查你的 配置文件位置是不是配置的正确,下面是配置文件的配置方式
<!-- 引入缓存的配置文件properties --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreResourceNotFound" value="true" /> <property name="ignoreUnresolvablePlaceholders" value="true" /> <property name="locations"> <list> <!-- 此位置是相对于:部署后的项目根路径 --> <!-- <value>/WEB-INF/cache.properties</value> --> <!-- 此位置是相对于:文件直接在src 目录下 --> <!-- <value>classpath*:cache.properties</value> --> <!-- 此位置是相对于:文件在目录下面 --> <!-- <value>classpath*:cache/cache.properties</value> --> <value>classpath*:/cache/cache.properties</value> <!-- 此位置是从服务器环境变量中查找名为:XXX 的值(例如:file:D:/test/test.properties) --> <!-- <value>${XXX}</value> --> <!-- 此位置是相对于:文件系统 --> <!-- <value>file:D:/test/test.properties</value> --> </list> </property> </bean>
相关文章推荐
- spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper
- spring mvc 数据绑定报错 Failed to convert property value of type 'java.lang.String' to required type 'int'
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e
- Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for pr
- Failed to convert property value of type [java.lang.String] to required type [int]
- springmvc-- Failed to convert property value of type 'java.lang.String' to required type
- Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for pr
- 关于springMVC中:Failed to convert property value of type 'java.lang.String' to required type 'java.util
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
- Failed to convert property value of type [java.lang.String] to required type [boolean] for property
- Failed to convert value of type 'java.lang.String' to required type 'org.springframework.web.multipa
- Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for pr
- 《Springboot极简教程》MappingMongoConverter:Failed to convert from type [java.lang.String] to type [long] for value 'null'; ne
- [置顶] 解决:Failed to convert value of type 'java.lang.String' to required type 'java.util.Date';
- 表单提交时候"Failed to convert property value of type [java.lang.String] to
- 解决:Failed to convert value of type 'java.lang.String' to required type 'java.util.Date';
- SpringMVC Failed to convert from type java.lang.String to type java.util.Date for value '2014-12-02'
- Failed to convert property value of type 'java.util.Properties' to required type 'org.springframewor
- Cannot assign value of type 'java.lang.String' to property 'file' of type 'org.apache.struts.upload.FormFile'
- 配置Spring Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource]