SerializationException: Could not read JSON: Unrecognized field

这篇具有很好参考价值的文章主要介绍了SerializationException: Could not read JSON: Unrecognized field。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field

原因:对象中如果有setXXXgetXXX方法,或返回值为BooleanbooleanisXXX方法,但没有对应的XXX字段,使用Jackson2JsonRedisSerializer序列化后json中会有对应的key值XXX,从而会导致反序列化失败。

解决办法:在类加上注解@JsonIgnoreProperties(ignoreUnknown = true)忽略实体中没有对应的json的key值,或者在set、get或is开头的方法上加上@JsonIgnore注解。

代码定位:(第一次序列化时调用,后续从缓存中取)
DefaultValueOperations 235 set
AbstractOperations 127 rawValue
org.springframework.data.redis.serilizer.Jackson2JsonRedisSerializer 86 serilizer
com.fasterxml.jackson.databind.ObjectMapper 3428 writeValueAsBytes
ObjectMapper 4094 _configAndWriteValue
DefaultSerializerProvider 308 serializeValue
SerializerProvider 713 findTypedValueSerializer
SerializerProvider 510 findValueSerializer
SerializerProvider 1336 _createAndCacheUntypedSerializer 此处将序列化器加入缓存
SerializerProvider 1388 _createUntypedSerializer
BeanSerializerFactory 165 createSerializer
BeanSerializerFactory 216 _createSerializer2
BasicSerializerFactory 346 findSerializerByAnnotations
BasicBeanDescription findJsonValueAccessor 252
POJOPropertiesCollector getJsonValueAccessor 196
POJOPropertiesCollector collectAll() 309
POJOPropertiesCollector _addMethods 533
POJOPropertiesCollector _addGetterMethod 583、586
BeanUtil okNameForRegularGetter 38
BeanUtil okNameForIsGetter 69文章来源地址https://www.toymoban.com/news/detail-491284.html

到了这里,关于SerializationException: Could not read JSON: Unrecognized field的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • IDEA Git 报错could not read from remote repository

    Git:could not read from remote repository。 首先再git后台,检查是否有对应工程的权限 1  检查idea工程project目录下的.git文件夹下的.config文件,origin配置是否正确 打开.config文件,url有两种方式:https的方式、ssh的方式, 检查对应的url是否正确 2 如果正确,请配置ssh 密钥,网上随便

    2024年02月08日
    浏览(29)
  • git 解决 “fatal: Could not read from remote repository.“

    现象 在使用Git将本地仓库推送到远程仓库的时候,发生了如下错误:“fatal: Could not read from remote repository.”   原因 出现这错误一般是以下两种原因: 客户端与服务端未生成 ssh key 客户端与服务端的ssh key不匹配 为解决以上问题,我们需要重新生成一次ssh key ,并重新配置一

    2024年02月09日
    浏览(31)
  • git pull 报错 could not read from remote repository解决

    git pull 报错 remote: Your account has been blocked. fatal: could not read from remote repository。一般是SSH的形式clone的仓库,权限被更改了。 如下步骤解决: 重新 生成 gitLabKey 并应用:                  step 1:     使用命令 ssh-keygen -t rsa -b 2048 -C \\\"lvl@svtc.com\\\"                  step 2:     出现

    2024年02月16日
    浏览(25)
  • github 无语的问题,Host does not existfatal: Could not read from remote repository.

    Unable to open connection: Host does not existfatal: Could not read from remote repository. image.png image.png image.png Please make sure you have the correct access rights and the repository exists. 如果github desktop和git pull 和git clone全部都出问题了,那问题出在路由器,或者dns上了, 在cmd中ping不同,不过是设置cmd代理或

    2024年02月09日
    浏览(32)
  • Permission denied (publickey). fatal: Could not read from remote repository.

    将本地代码推送到远程分支报错:Permission denied (publickey). fatal: Could not read from remote repository. 确保已经添加了正确的 SSH 密钥。可以使用以下命令检查 SSH 密钥是否已经添加: 如果看到消息 “Hi [username]! You\\\'ve successfully authenticated, but GitHub does not provide shell access.” ,则表示已成

    2023年04月18日
    浏览(25)
  • fatal: could not read Username for ‘https://git.xxx.com‘: Device not configured

    使用sourcetree完成当前项目时报错 1、创建的feature分支,完成当前项目时 2、创建的hotfix分支,完成当前项目时 1.在使用 webhook 自动部署时测试出现此问题 2.这里是因为你的git仓库是有用户名和密码,但是你没有配置git仓库的用户名和密码,而导致的问题 1、在你的私有库文件

    2024年02月12日
    浏览(52)
  • git clone出现fatal: Could not read from remote repository解决办法

    在git clone一个项目时出现如下报错: (第一个选项,问你是否继续连接?输入yes然后回车) 通过报错信息可以看出,这是因为Github上没有本机的公钥导致的。 其中双引号中填自己Github注册账号用的邮箱地址。 点击回车,看到提示 说明:前三个冒号分别让你输入保存公钥的

    2023年04月15日
    浏览(69)
  • git报错:Permission denied (publickey). fatal: Could not read from remote repository.

    背景 :由于新换了电脑,新装了git,所以在用git拉取代码的时候就出现了标题一样的错误 ternimal下出现下面错误: Permissiondenied (publickey). fatal:Could not read from remote repository. Pleasemake sure you have the correct access rights and the repository exists. 分析原因 : 原因是由于你在本地(或者服务

    2024年02月05日
    浏览(35)
  • flink写mysql报错Could not retrieve transation read-only status server

    事务隔离级别前提下还是报错 SET GLOBAL tx_isolation=\\\'READ-COMMITTED\\\';    show global variables like \\\'wait timeout\\\'; 发现mysql是8小时。如果flnk超过8小时没有发送数据,invoke将会导致 mysql主动断开连接,而java侧并无感知。 解决问题,在使用connect前,判断当前connect是否可用。 不可用重新创建

    2024年02月07日
    浏览(27)
  • 解决git@github.com: Permission denied (publickey). Could not read from remote repository

    原因分析 Permission denied (publickey) 没有权限的publickey ,出现这错误一般是以下两种原因 客户端与服务端未生成 ssh key 客户端与服务端的ssh key不匹配 找到问题的原因了,解决办法也就有了,重新生成一次ssh key ,服务端也重新配置一次即可。 客户端生成ssh key 470812087@qq.com改为

    2024年02月04日
    浏览(48)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包