当前位置: 首页 > article >正文

FastJSON错误Could not read JSON: Unrecognized field

系列文章目录


文章目录

  • 系列文章目录
  • 前言
  • 一、主要特点


前言

前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站,这篇文章男女通用,看懂了就去分享给你的码吧。
在这里插入图片描述
fastjson 是一个性能很好的 Java 语言实现的 JSON 解析器和生成器,来自阿里巴巴的工程师开发。


一、主要特点

快速FAST (比其它任何基于Java的解析器和生成器更快,包括jackson)

强大(支持普通JDK类包括任意Java Bean Class、Collection、Map、Date或enum)

零依赖(没有依赖其它任何类库除了JDK)
在使用FastJSON时,报错Could not read JSON: Unrecognized field,详细错误如下

org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field "normol" (class com.example.springboot.model.Blog), not marked as ignorable (5 known properties: "isDel", "id", "birthday", "name", "del"])
 at [Source: (byte[])"["com.example.springboot.model.Blog",{"id":1,"name":"Java小强","isDel":false,"birthday":["java.util.Date","2024-01-15 13:45:38"],"del":false,"normol":true}]"; line: 1, column: 157] (through reference chain: com.example.springboot.model.Blog["normol"]); nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "normol" (class com.example.springboot.model.Blog), not marked as ignorable (5 known properties: "isDel", "id", "birthday", "name", "del"])
 at [Source: (byte[])"["com.example.springboot.model.Blog",{"id":1,"name":"Java小强","isDel":false,"birthday":["java.util.Date","2024-01-15 13:45:38"],"del":false,"normol":true}]"; line: 1, column: 157] (through reference chain: com.example.springboot.model.Blog["normol"])
 
    at org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer.deserialize(Jackson2JsonRedisSerializer.java:75)
    at org.springframework.data.redis.core.AbstractOperations.deserializeValue(AbstractOperations.java:360)
    at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:62)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:191)
    at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:97)
    at org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:54)
    at com.example.springboot.redis.RedisTest.objTest(RedisTest.java:366)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    at org.junit

http://www.kler.cn/a/271323.html

相关文章:

  • 如何重置iPhone的网络设置?这里提供详细步骤
  • 【Leetcode】top 100 矩阵
  • NCV4275CDT50RKG稳压器芯片中文资料规格书PDF数据手册引脚图图片价格功能
  • SpingBoot集成Rabbitmq及Docker部署
  • xss-labs level 10-20
  • Lua-Lua与C++的交互2
  • Redis远程连接本机——Docker
  • PDF Expert:强大注释与批注功能,让PDF阅读更高效
  • springboot整合swagger,postman,接口规范
  • java serlvet 高校学生画像平台系统Myeclipse开发mysql数据库web结构java编程计算机网页项目echarts图形展现
  • 算法训练营day50(补),单调栈2
  • MySQL安装(Mac系统)
  • 智慧城市与数字孪生:共创未来城市的智慧生活
  • HCIP—OSPF课后练习一
  • 实现HBase表和RDB表的转化(附Java源码资源)
  • 由浅到深认识C语言(11):结构体
  • nginx多级代理配置获取客户端真实ip
  • 【运维】StarRocks数据迁移到新集群(针对于集群互通、不互通的情况)
  • Kubernetes kafka系列 | k8s部署kafka+zookeepe集群(可外部通信)
  • 15.7k stars一个实用型OCR,支持80多种语言