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.jupiter.engine.extension.TimeoutExtension
  • 22
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Java毕设王

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值