`
woshixushigang
  • 浏览: 575774 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类

org.springframework.beans.TypeMismatchException: Failed to convert property valu

 
阅读更多
org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'null' to required type 'int' for property 'order'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [null] to required type [int] for property 'order': PropertyEditor [org.springframework.beans.propertyeditors.CustomNumberEditor] returned inappropriate value

spring jdbc 执行

resultList = this.namedJdbcTemplate.query(sqlbf.toString(), paramSource, mappingResult(CommonConfigVO.class));

private RowMapper mappingResult(Class<?> resultBean) {
		return new BeanPropertyRowMapper(resultBean);
	}

 报错,数据库中 order 有 0 和null

 

从数据库中取出来的order值必须是int 如何Null 就会报错,所以数据库最好有个默认值为0.

 

 

分享到:
评论
2 楼 woshixushigang 2013-06-13  
good
1 楼 nathanleewei 2013-06-04  
org.springframework.jdbc.core.BeanPropertyRowMapper.setPrimitivesDefaultedForNullValue(true);
or
org.springframework.jdbc.core.ParameterizedBeanPropertyRowMapper.setPrimitivesDefaultedForNullValue(true);

相关推荐

    org.spring-framework-3.0.4. 所有jar

    org.springframework.beans-3.0.4.RELEASE.jar org.springframework.context.support-3.0.4.RELEASE.jar org.springframework.context-3.0.4.RELEASE.jar org.springframework.core-3.0.4.RELEASE.jar org....

    org.springframework.flex-1.0.3.RELEASE.jar.zip

    org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包,org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包org.springframework.flex-1.0.3....

    org.springframework.transaction-3.1.2.RELEASE.zip

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0': Error setting property values; nested ...

    org.springframework.web.servlet-3.0.1.RELEASE-A.jar

    nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Error ...

    spring3.0.5 所有jar文件

    org.springframework.beans-3.0.5.RELEASE.jar org.springframework.context-3.0.5.RELEASE.jar org.springframework.context.support-3.0.5.RELEASE.jar org.springframework.core-3.0.5.RELEASE.jar org.spring...

    aopalliance-1.0.jar,org.springframework.aop-3.0.0.RELEASE.jar

    aopalliance-1.0.jar,org.springframework.aop-3.0.0.RELEASE.jar,org.springframework.jdbc-3.0.0.RELEASEorg.springframework.beans-3.0.0.RELEASE.jar等

    org.springframework.web.jar

    9. **Integration with other Spring Modules**:`org.springframework.web.jar`与Spring框架的其他模块紧密集成,如Spring Core、Spring Beans、Spring AOP等,共同构建出一个完整的应用框架。 总的来说,`org....

    org.springframework.beans-3.0.0.M4.jar

    org.springframework.beans-3.0.0.M4.jar

    org.springframework.beans-3.0.5工程所需jar包

    org.springframework.beans-3.0.5工程所需jar包,com.springsource.net.sf.cglib-2.2.0.jar、 com.springsource.org.apache.commons.logging-1.1.1.jar、 javax.inject.jar、 javax.servlet.jsp.jar、 org.spring...

    org.springframework.beans-sources-3.0.5.release.jar

    org.springframework.beans-sources-3.0.5.release.jar

    org.springframework.test-3.0.2.RELEASE.jar

    import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...

    spring3.1 官方全部jar包

    org.springframework.beans-3.1.RELEASE.jar org.springframework.context.support-3.1.RELEASE.jar org.springframework.context-3.1.RELEASE.jar org.springframework.core-3.1.RELEASE.jar org.spring...

    Spring所需jar包

    org.springframework.beans-3.0.0.RELEASE.jar org.springframework.context.support-3.0.0.RELEASE.jar org.springframework.context-3.0.0.RELEASE.jar org.springframework.core-3.0.0.RELEASE.jar org.spring...

    spring3.1.1jar及其关联jar

    org.springframework.beans-3.1.1.RELEASE org.springframework.context.support-3.1.1.RELEASE org.springframework.context-3.1.1.RELEASE org.springframework.core-3.1.1.RELEASE org.springframework....

    spring-beans-5.0.10.RELEASE-API文档-中文版.zip

    Maven坐标:org.springframework:spring-beans:5.0.10.RELEASE; 标签:spring、beans、springframework、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可...

    org.springframework.beans-3.1.0.M2

    org.springframework.beans-3.1.0.M2

    spring-beans-5.2.0.RELEASE-API文档-中英对照版.zip

    Maven坐标:org.springframework:spring-beans:5.2.0.RELEASE; 标签:springframework、spring、beans、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览...

    spring3.0.0相关jar包

    org.springframework.beans-3.0.0.RELEASE org.springframework.context.support-3.0.0.RELEASE org.springframework.context-3.0.0.RELEASE org.springframework.core-3.0.0.RELEASE org.springframework....

    spring-beans-5.2.0.RELEASE-API文档-中文版.zip

    Maven坐标:org.springframework:spring-beans:5.2.0.RELEASE; 标签:springframework、spring、beans、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档...

    解决The type org.springframework.dao.support.DaoSupport cannot be resolved.bao报错

    从提供的文件列表看,有两个Spring库:`org.springframework.beans-3.0.2.RELEASE.jar`和`spring-tx-3.2.4.RELEASE.jar`。`DaoSupport`位于`spring-dao`模块中,而不是这两个jar中。你需要确保你的构建配置(如Maven...

Global site tag (gtag.js) - Google Analytics