no suitable constructor found, can not deserialize from Object value (missing default constructor or
来源:互联网 发布:悲伤的网络歌曲 编辑:程序博客网 时间:2024/05/22 02:09
spring cloud 运行中,启动了provider,再启动了consumer,然后在consumer中向provider发送请求报错:
2017-04-27 09:34:23.234 WARN 2176 --- [nio-7900-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not construct instance of com.sino.cloud.entity.User: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
at [Source: java.io.PushbackInputStream@5f26848a; line: 1, column: 3] (through reference chain: java.lang.Object[][0]);
这个错误的起源是因为我做测试,没有使用数据库,在findAll()方法里直接循环new的user对象,所以报错找不到合适的user对象的构造,这是检查我的user类中,我是有含参构造,然后由于错误是400,所以我加入了无参构造,都加,然后重新运行请求,正常!
- no suitable constructor found, can not deserialize from Object value (missing default constructor or
- default constructor not found解决方法
- JsonMappingException: No suitable constructor found for type
- Constructor or not constructor?
- fastjson混淆后default constructor not found.
- MissingMethodException: Default constructor not found for type
- Could not instantiate bean class [com.bjsxt.service.UserService]: No default constructor found;
- default constructor and no-parameter constructor
- MyBatis - No constructor found
- mybatis--No constructor found
- Mybatis-No constructor found
- 【SpringBoot】“没有默认的构造器”,No default constructor found;
- 使用Spring报错:No default constructor found;
- fastjson解析json时报错default constructor not found. class.............
- fastjson解析json时报错default constructor not found. class............
- com.alibaba.fastjson.JSONException: default constructor not found
- kotlin使用com.alibaba.fastjson.JSONException: default constructor not found
- C++ Object Model: Default Constructor
- ajax我遇到的几种写法
- 浅谈React的类型检测——PropTypes
- 60-客户端也能做服务器?
- windows logstash cannot find log4j2.properties file
- python 实现简单的端口扫描器
- no suitable constructor found, can not deserialize from Object value (missing default constructor or
- rabbitmq 管理 及 常用命令
- 基于Appium+JAVA环境测试iOS
- DELETE_FAILED_INTERNAL_ERROR
- Android 热修复方案--阿里百川HotFix
- java异常——no such provider:BC
- android工具
- iPhone、Android均适用的判断是不是微信浏览器方法js版
- JavaWeb 入门级项目实战 -- 文章发布系统 (第四节)