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 ...
随机推荐
- pl/sql学习(5): 触发器trigger/事务和锁
(一)触发器简单介绍 触发器是由数据库的特定时间来触发的, 特定事件主要包括以下几种类型: (1)DML: insert, update,delete 增删改 (2)DDL: create, alte ...
- 爬虫高性能 asyncio库 twisted库 tornado库
一 背景知识 爬虫的本质就是一个socket客户端与服务端的通信过程,如果我们有多个url待爬取,只用一个线程且采用串行的方式执行,那只能等待爬取一个结束后才能继续下一个,效率会非常低. 需要强调的是 ...
- day17递归函数(二分法查找)
递归函数: 如果函数包含了对其自身的调用,该函数就是递归的: example 1:二分法查找的实现: def find_recursion(l,aim,start=0,end=None): #end不 ...
- 快速启动FTP下载服务器
nohup python -m SimpleHTTPServer 8000 > myout.file 2>&1 &
- 会跳高的字体插件jquery.beattext.js
插件描述:字体特效,会弹跳的字体插件jquery.beattext.js,兼容性如下: 使用方法 导入如下3个js文件: <script type="text/javascript&q ...
- UIWebView的常用方法
//webview导航栏类型enum UIWebViewNavigationType : Int { case LinkClicked case FormSubmitted case BackForw ...
- James Munkres Topology: Theorem 20.4
Theorem 20.4 The uniform topology on \(\mathbb{R}^J\) is finer than the product topology and coarser ...
- SQL反模式学习笔记17 全文搜索
目标:全文搜索 使用SQL搜索关键字,同时保证快速和精确,依旧是相当地困难. SQL的一个基本原理(以及SQL所继承的关系原理)就是一列中的单个数据是原子性的. 反模式:模式匹配 使用Like 或者正 ...
- entityframework单例模式泛型用法
public class yms_Entity<T> where T :DbContext { private static T _instance; public static read ...
- Redis数据结构之ziplist
本文及后续文章,Redis版本均是v3.2.8 本篇文章我们来分析下一种特殊编码的双向链表-ziplist(压缩列表),这种数据结构的功能是将一系列数据与其编码信息存储在一块连续的内存区域,这块内存物 ...