解决:cannot deserialize from Object value (no delegate- or property-based Creator)
解决:cannot deserialize from Object value (no delegate- or property-based Creator)
前因后果:
前两天在写一个简单页面的时候,前端通过ajax请求发送参数,后端创建了一个实体类用来接收参数,这个实体类添加了Lombok的@Data注解,没有创建其他构造函数,当前端发送请求时后端控制台就会抛出以下异常,后经过查询发现原来是因为实体类没有无参构造函数造成的。
解决方式:
手动创建一个无参构造器或者添加Lombok注解@NoArgsConstructor即可。
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com.thunisoft.commons.cryptoonline.bean.ParamBean]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.thunisoft.commons.cryptoonline.bean.ParamBean` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)at [Source: (PushbackInputStream); line: 1, column: 2]] with root causecom.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.thunisoft.commons.cryptoonline.bean.ParamBean` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)at [Source: (PushbackInputStream); line: 1, column: 2]
解决:cannot deserialize from Object value (no delegate- or property-based Creator)相关推荐
- 【已解决】cannot deserialize from Object value 异常
目录 零.参考文献 一.写在前面 二.问题场景 三.场景重现 服务端代码: 四.解决方案 五.总结反思 六.写在后面 零.参考文献 关于 cannot deserialize from Object ...
- 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘
解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...
- 成功解决 class 'AttributeError' : 'Editor' object has no attribute '_Editor__markerMap'
成功解决 class 'AttributeError' : 'Editor' object has no attribute '_Editor__markerMap' 解决问题 An error lo ...
- 成功解决TypeError: a bytes-like object is required, not 'str'
成功解决TypeError: a bytes-like object is required, not 'str' 目录 解决问题 解决思路 解决方法 解决问题 TypeError: a bytes- ...
- 成功解决AttributeError: 'collections.defaultdict' object has no attribute 'iteritems'
成功解决AttributeError: 'collections.defaultdict' object has no attribute 'iteritems' 目录 解决问题 解决思路 解决方法 ...
- 报错解决:AttributeError: ‘Word2VecKeyedVectors‘ object has no attribute ‘save_Word2Vec_format‘
报错解决:AttributeError: 'Word2VecKeyedVectors' object has no attribute 'save_Word2Vec_format' 不知道按网上自己学 ...
- Improved 3D Object Detector Under Snowfall Weather Condition Based on LiDAR Point Cloud
Improved 3D Object Detector Under Snowfall Weather Condition Based on LiDAR Point Cloud Method Doubl ...
- 解决webpack4版本在打包时候出现Cannot read property ‘bindings‘ of null 或 Cannot find module ‘@babel/core‘问题
解决webpack4版本在打包时候出现Cannot read property 'bindings' of null 或 Cannot find module '@babel/core'问题 参考文章 ...
- Javascript 对象不支持此属性或方法,Object doesn’t support this property or method
中文 Microsoft 对VBscript出现这种错误的解释 Visual Basic 参考:错误消息. 对象不支持此属性或方法(Visual Basic). 为此自动化对象指定的方法或属性不存在 ...
- 解决Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING
今天通过PostMan工具来测试一个接口时报这个错误,出现该错误的原因是提交错误的值到后端进行映射,比如在实体类中定义了某个属性类型为List数组,如下图所示: 然后我们在接口提交的值是字符串,如下图 ...
最新文章
- vue全家桶 ---axios的使用和二次封装
- rabbitmq几种工作模式_RabbitMQ六种队列模式-简单队列模式
- _Linux安装软件方法总结
- 【转】使用C#发送Http 请求实现模拟登陆(以博客园为例)
- 无法连接到RDP服务器
- 体验Rabbitmq强大的【优先级队列】之轻松面对现实业务场景
- 从二项分布到泊松分布再到正态分布
- MySQL架构体系(从一条语句出发了解MySQL各部分的作用)
- 综合能源系统及其应用
- java基础习题_JAVA基础练习题
- 目标管理 - SMART原则
- Adams入门详解与实例(第2版)pdf电子书
- Speex编解码手册
- base64加密后字符串自动换行问题
- python如何读取dbf文件_Python如何读取DBF文件
- Pytorch tutorial pytorch 入门
- app怎么调用mysql数据_教你如何拿别人APP中的数据
- mysql火焰图_技术|如何读懂火焰图?
- 图片瘦身的正确姿势,让你的 CDN 费用省 50% 以上!
- java关键字有什么用_JAVA中关键字有什么用