Jackson2JsonRedisSerializer报错Could not read JSON: Unrecognized field...
来源:互联网 发布:mssql数据库 查询语句 编辑:程序博客网 时间:2024/05/16 14:49
nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “credentialsSalt” (class com.scl.user.domain.SysUser), not marked as ignorable
- 说明:
在实体类SysUser中,写了一个方法:
/** * 加盐 * @return */ public String getCredentialsSalt() { return username + salt; }
但是credentialsSalt不是SysUser实体类的一个属性,发现在redis中保存的json字符串却有credentialsSalt属性:
["com.scl.user.domain.SysUser",{"id":"b2edd69c593547bfaa9d854db2442c43","username":"scl","password":"e7e4c6820a93d65cf7ea0cb2a53b4d27","salt":"b91fbff177d9e463846f783ce4b889ef","isLocked":0,"isDelete":0,"createBy":"b2edd69c593547bfaa9d854db2442c43","createTime:["java.util.Date",1486457416000]","updateBy":null,"updateTime":null,"credentialsSalt":"sclb91fbff177d9e463846f783ce4b889ef"}]
确定名为get...的方法在Jackson2JsonRedisSerializer使用中 会被序列化成一个属性值到json字符串中。
- 解决方案:
除了实体类的属性的getter方法,不要写其他的getter方法(用其他方法名代替)
0 0
- Jackson2JsonRedisSerializer报错Could not read JSON: Unrecognized field...
- could not read json : unrecognized field "$$hashkey"
- java web 用ajax封装json报错Could not read JSON: Unrecognized token 'name': was expecting 'null', 'true',
- 报错 Could not retrieve transation read-only status server
- linux安装make apache报错 Could not read symbols
- weblogic10.3 启动报错 Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine
- springboot 报错Field XXX required a bean of type XXX that could not be found.
- Could not autowire field
- Could not autowire field
- SpringMVC json 转换中错误的解决: Unrecognized field , not marked as ignorable
- php make报错:/usr/local/openssl/lib/libssl.a: could not read symbols: Bad value
- SSH环境mysql6.0报错Could not retrieve transation read-only status server
- svn报错:could not read response body connection was closed by server
- 解决Android Studio Gradle 'app'project refresh failed 报错 Could not read cache value问题
- [已解决]Android studio git报错 could not read from remote repository
- Android Studio报错Could not read cache value from “...” 的解决方法
- CentOS6升级openssl报错libcrypto.a(rsaz_exp.o): could not read symbols: Bad value
- mysql 报错Could not retrieve transation read-only status server
- 4招,教你玩转社群营销?
- android系统屏幕密度
- Android里Activity的启动模式
- leecode 解题总结:111. Minimum Depth of Binary Tree
- 1076. Forwards on Weibo (30)
- Jackson2JsonRedisSerializer报错Could not read JSON: Unrecognized field...
- [LOG]AC自动机
- 无题之一
- Xcode代码块转移备份同步(CodeSnippets)代码块路径
- Handler、Thread和HandlerThread的差别
- DockerInAction-Build automation and advanced image considerations
- tableViewCell中添加webView,cell自适应webView高度,解决死循环的简单办法
- X86 dismatch X64 visual studio
- 蓝桥 大臣的旅费