##Can not deserialize instance of java.lang.String out of START_OBJECT token
请求中定义了一个String字段,该字段主要是一个JSON Object字符串,对应的Java PO的相关字段类型是String。
但是测试的时候传的参数是JSON对象,例如{"aa":"bb"}被识别出是JSONObject,所以在转换参数为PO时会抛出该异常。
就是说当你遇到这个异常时,需要检查一下传过来的参数是不是符合PO里面定义的数据类型。
在我遇到的情况里,我把相关参数改为"{\"aa\":\"bb\"}"就可以解决这个问题了
原因就是 ; 当传输 JSON Object 字符串的时候 被识别为 JSonObject {json 对象 } 故 报错
解决方案: 检查参数类型设置 记得 加 注解 @requestBody 等 相关设置
##Can not deserialize instance of java.lang.String out of START_OBJECT token的更多相关文章
- Jackson错误:Can not deserialize instance of java.lang.String out of START_OBJECT token
org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not des ...
- JSON parse error: Can not deserialize instance of java.lang.String out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of j
异常信息如下: JSON parse error: Can not deserialize instance of java.lang.String out of START_OBJECT token ...
- 解决用户自生成meta导入kylin后报错问题Can not deserialize instance of java.lang.String[] out of VALUE_STRING token
报错栈: -- ::, ERROR [http-bio--exec-] cube.CubeManager: : Error during load cube instance, skipping : ...
- Could not read document: Can not deserialize instance of java.lang.String out of START_ARRAY
线上问题: { "timestamp": "1544510665", "status": 400, "error": & ...
- Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx': no matching editors or conversion strategy found
今天在完成项目的时候遇到了下面的异常信息: 04-Aug-2014 15:49:27.894 SEVERE [http-apr-8080-exec-5] org.apache.catalina.cor ...
- spring3+struts2+hibernate3整合出现的问题,No mapping found for dependency [type=java.lang.String, name='struts.objectFactory.spring.enableAopSupport']
七月 11, 2016 3:49:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule ...
- java.lang.String 类源码解读
String类定义实现了java.io.Serializable, Comparable<String>, CharSequence 三个接口:并且为final修饰. public fin ...
- java.lang.String cannot be cast to scala.runtime.Nothing Scala中的Nothing类型
经常在写Rdd的时候, 如: val OWNER_ID=row.getAs("OWNER_ID") 等, 运行是可能会报异常 : java.lang.String cannot ...
- [Spring]:java.lang.NoSuchMethodError: 'java.lang.String javax.annotation.Resource.lookup()'
错误信息 11月 05, 2019 9:32:15 下午 org.springframework.test.context.TestContextManager prepareTestInstance ...
- java.lang.String.getBytes(String charsetName)方法实例
java.lang.String.getBytes(String charsetName) 方法编码将此String使用指定的字符集的字节序列,并将结果存储到一个新的字节数组. 声明 以下是java. ...
随机推荐
- matplotlab可视化学习
1 使用pip安装 使用 Python 包管理器 pip 来安装 Matplotlib 是一种最轻量级的方式.打开 CMD 命令提示符窗口,并输入以下命令: pip install matplotli ...
- 碉堡!“万物皆可分”标记模型上线「GitHub 热点速览」
这周有个让人眼前一亮的图像识别模型 segment-anything,它能精细地框出所有可见物体,它标记出的物体边界线清晰可见.如此出色的模型,自然获得了不少人的赞赏,开源没几天,就拿下了 18k+ ...
- django模糊查询排序
class Book(models.Model): """ 列名 """ class Meta: db_table = 'book' nam ...
- ts、typescript、enum、枚举、ts 获取枚举对应的类型、获取 enum 的 key 和 value
ts.typescript.enum.枚举.ts 获取枚举对应的类型 // 假设我一个枚举 enum ENUM_TYPE { ALL = 'all', SOME = 'some', LITTLE = ...
- Prism Sample 19-NavigationParticipation
Navigation Participation,不知翻译方法,意思是对导航过程的参与,触发事件,类似离开导航目标和进入导航的回调 在VM中,增加一个接口 ,然后实现导航事件 public class ...
- Nuxt3.0中使用EChart可视化图表📊
在Nuxt3.0项目中用到了可视化图表,于是我用了EChart可视化图表库.但是在官网我没有找到针对在Nuxt3.0中使用EChart的方法,于是在这里记录我的引入EChart并简单使用的步骤.需要声 ...
- vue【解决方案】页面/路由跳转后,滚动条消失,页面无法滚动
原因解析: vue项目中,页面/路由跳转后,body 的内联样式变成 overflow:hidden 解决方案: 使用路由守卫,在页面/路由跳转后,将body 的overflow设置为auto src ...
- mac系统下,docker安装kibana报错,manifest for kibana:latest not found: manifest unknown: manifest unknown
1.问题描述:mac系统下,docker安装kibana报错,manifest for kibana:latest not found: manifest unknown: manifest unkn ...
- Python对word文档重排版
介绍 舍友从网上下载的word题库文档很乱,手动改了大半天才改了一点,想起python是大名鼎鼎的自动化脚本,于是乎开始了python对word的一顿瞎操作. 分析需求 对文档中的内容进行分析,只留下 ...
- WPF入门教程系列二十四——DataGrid使用示例(2)
WPF入门教程系列目录 WPF入门教程系列二--Application介绍 WPF入门教程系列三--Application介绍(续) WPF入门教程系列四--Dispatcher介绍 WPF入门教程系 ...