Tried to assign property OutStationNo:java.lang.Integer to bean of class
2017-10-25 11:26
811 查看
net.sf.json.JSONObject net.sf.json.JSONObject.toBean(JSONObject.java:431) - Tried to assign property OutStationNo:java.lang.Integer to bean of class com.newsoft.roadService.po.FeeVO net.sf.json.JSONObject net.sf.json.JSONObject.toBean(JSONObject.java:431) - Tried to assign property VehClassNo:java.lang.Integer to bean of class com.newsoft.roadService.po.FeeVO net.sf.json.JSONObject net.sf.json.JSONObject.toBean(JSONObject.java:431) - Tried to assign property WayTypeNo:java.lang.Integer to bean of class com.newsoft.roadService.po.FeeVO
今天偶然在调试程序的时候,偶然发现这个警告,同时还发现当json转换为bean对象时,发现上述报警告的这些值在对象中全部为空。
看了源码也找不到问题所在,后面发现与该对象中其他值唯一不同的地方就是开头字母大写了。(接口文档中规定第一个字母大写,故出现此种情况)
解决方案:
在研究该问题时,发现有两种解决方案
1、将该bean对象的首字母全部改为小写。
2、将该bean对象的首字母大写的后面几个单词改为大写(开头算起,连续的大写字母数量>1)
相关文章推荐
- mybaits错误解决:There is no getter for property named 'userId' in 'class java.lang.Integer'
- Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。
- Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。
- mybatis 基本类型的if条件判断问题 There is no getter for property named 'xxx' in 'class Java.lang.Integer'
- javax.el.ELException: Cannot convert 1 of type class java.lang.Integer to class java.lang.Boolean
- Cannot convert 0 of type class java.lang.Integer to class java.lang.Boolean
- javax.el.ELException: Cannot convert 1 of type class java.lang.Integer to class java.lang.Boolean
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'funcSetId' in 'class java.lang.Integer'
- Cannot assign value of type 'java.lang.String' to property 'file' of type 'org.apache.struts.upload.FormFile'
- There is no getter for property named 'xxxx' in 'class java.lang.Integer
- mybatis String的if条件判断问题 There is no getter for property named 'xxx' in 'class Java.lang.Integer'
- mybaits的There is no getter for property named 'id' in 'class java.lang.Integer异常
- There is no getter for property named 'id' in 'class java.lang.Integer'问题解决办法
- There is no getter for property named 'id' in 'class java.lang.Integer'
- Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。
- There is no getter for property named 'name' in 'class java.lang.Integer'
- There is no getter for property named 'id' in 'class java.lang.Integer
- There is no READABLE property named 'id' in class 'java.lang.Integer'
- There is no getter for property named 'id' in 'class java.lang.Integer
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e