关于springmvc中jackson的No suitable constructor found for type错误
来源:互联网 发布:win10禁用windows键 编辑:程序博客网 时间:2024/05/17 13:41
启
需要调用个第三方rest接口。偷了个懒把json对象定义在了文件内,没有单独建立一个外部类而是做了个内部类。结果就是不停地报"No suitable constructor found for type"。
承
不是没有无参构造函数;不是因为内部类被设置为private;将内部类原模原样拷出来单独建立一个外部类就一切ok了,不然就是报一万年上述错误。仅作现象记录,暂不去分析原由,总之忒奇怪了。
结
用到json时,还是需要中规中矩。单独建立json对象文件;保证有默认无参构造函数;保证有set&get方法。然后能节省一堆debug时间。至于上述现象的原理需要看jackson的实现细节,应该是和反射之类相关。最后这句猜的,反正连蒙带猜。
阅读全文
0 1
- 关于springmvc中jackson的No suitable constructor found for type错误
- JsonMappingException: No suitable constructor found for type
- org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [si
- com.fasterxml.jackson.databind.JsonMappingException:No suitable constructor found for type
- No suitable constructor found for type [simple type, class com.bonc.vbap.dataservice.core.metadata.i
- Json转对象失败:"No suitable constructor found for type [simple type, class com.test.faster.domain.respons
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 解决ntp的错误 no server suitable for synchronization found
- 四种色彩模式ARGB_8888、ARGB_4444、 RGB_565、 ALPHA_8的区别
- 2017计蒜客第二场(AB)
- springMVC接收返回json,基于spring4
- 跟我学TCP/IP系列2
- 计蒜客 百度的年会游戏【java】
- 关于springmvc中jackson的No suitable constructor found for type错误
- 跟我学TCP/IP系列3
- git 学习笔记
- setalpha和setimagealpha的区别详解
- [HNOI2008]玩具装箱
- Java集合类——HashSet
- struts2 no result defined for action xxxx and result input
- universal-image-loader源码解析
- android gps机制分析--定位数据HAL处理