fastJson解析报错:com.alibaba.fastjson.JSONException: can't create non-static inner class instance.
原因:
如果出现类嵌套类的情况,需要将被嵌套的那个类设置为static。
比如:
public class AA {
// 相关属性
public class BB {//会报错
// 相关属性
}
}
应该改为:
public class AA {
// 相关属性
public static class BB {
// 相关属性
}
}
fastJson解析报错:com.alibaba.fastjson.JSONException: can't create non-static inner class instance.的更多相关文章
- 解决使用Redis时配置 fastjson反序列化报错 com.alibaba.fastjson.JSONException: autoType is not support
1.问题描述 在使用redis时,配置自定义序列化redisTemplate为FastJsonRedisSerializer . 1 /** 2 * 自定义redis序列化器 3 */ 4 @Sup ...
- 使用Redis 配置替换fastjson 反序列化报错 com.alibaba.fastjson.JSONException: autoType is not support
新建的GenericFastJson2JsonRedisSerializer里面添加白名 添加: static { ParserConfig.getGlobalInstance().ad ...
- java后台接收json数据,报错com.alibaba.fastjson.JSONObject cannot be cast to xxx
从前台接收json封装的list数据,在后台接收时一直报错,com.alibaba.fastjson.JSONObject cannot be cast to xxx, 使用这种方式接收可以接收 @R ...
- pip运行报错Fatal error in launcher: Unable to create process using pip.exe
使用pip的时候报错Fatal error in launcher: Unable to create process using pip.exe 解决办法,升级pip python -m pip i ...
- pip3命令报错Fatal error in launcher: Unable to create process using '"d:\old_files\py3.6\python.exe" "E:\py3.6\Scripts\pip3.exe" list'
cmd输入pip3 list命令报错 Fatal error in launcher: Unable to create process using '"d:\old_files\py3.6 ...
- 【踩坑】报错 non-static method xxx() cannot be referenced from a static context
今天测试代码时遇到 Error:(6, 55) java: non-static method sayGoodbye() cannot be referenced from a static cont ...
- 解决报错:ERROR 1005 (HY000): Can't create table 'market.orders' (errno: 150)
1.描述问题: 在这里我新建了两张表(customers_info和orders) 表一:customers_info CREATE TABLE customers_info ( c_num INT( ...
- fastjson转换包含date类型属性的对象时报错com.alibaba.fastjson.JSONException: For input string: "13:02:19"
问题:time类型数据插入不进mysql数据库:调试的时候报如下错误: Caused by: java.lang.NumberFormatException: For input string: &q ...
- 做文件上传下载时报这个错com.alibaba.fastjson.JSONException: illegal identifier : \
::-exec-] DEBUG c.i.e.m.I.insertDataEmebeding - <== Updates: ::-exec-] ERROR c.i.e.c.CaseArchiveC ...
随机推荐
- jmeter 使用白皮书
一.jmeter中的响应端言 断言就类似LoadRunner中的检查点.对上一个请求返回的信息,做字符串.数据包大小.HTML.XML.图片等做判断,确保返回的信息的准确性. 以下只讲解下响应断言步骤 ...
- springboot配置Druid数据源
springboot配置druid数据源 Author:SimpleWu springboot整合篇 前言 对于数据访问层,无论是Sql还是NoSql,SpringBoot默认采用整合SpringDa ...
- 2018秋季C语言学习总结
2018秋季开始学习c语言 1.printf格式化输出函数 2.基本数据类型,int整型,float浮点型,double双精度浮点型,char字符型 3.算数运算符 +加法,-减法,*乘法,/除法,% ...
- 设计模式学习之访问者模式(Visitor,行为型模式)(21)
参考:https://www.cnblogs.com/edisonchou/p/7247990.html 在患者就医时,医生会根据病情开具处方单,很多医院都会存在以下这个流程:划价人员拿到处方单之后根 ...
- Barber paradox
According to Wikipedia, the well known barber paradox states like this: The barber is the "one ...
- pc端网页,移动端网页(andorid、ios)离开页面做一个时间存储
如图所示:在一个页面中做了一个倒计时,然后用户想离开页面做其他事情,需求是离开页面之后把时间保存,下一次进来继续的时候时间还是上次离开的时间 第一次我用的事件是: // window.onbefor ...
- Android源代码下载 “Gerrit下载源代码”
repo init -u ssh://jenkins@gerrit.y:29419/manifest -m k86A.xml 使用-m参数指定具体使用的是k86A.mxl文件 步骤1. curl ht ...
- asp.net MVC jsonp跨域获取数据
public class JsonpResult : JsonResult { object _data = null; public JsonpResult() { } public JsonpRe ...
- 【搜索2】P1706 全排列问题
题目描述 输出自然数1到n所有不重复的排列,即n的全排列,要求所产生的任一数字序列中不允许出现重复的数字. 输入输出格式 输入格式: n(1≤n≤9) 输出格式: 由1-n组成的所有不重复的数字序列, ...
- 如何安装Magento 2.0
//来源:http://www.360magento.com/blog/install-magento2 如何安装Magento 2.0 2015/8/11 下午4:23 发布者: shi yong ...