GenericFastJsonRedisSerializer 反序列化失败

6ovsh4lw  于 2023-02-04  发布在  Redis
关注(0)|答案(1)|浏览(130)

打印的异常内容:

org.springframework.data.redis.serializer.SerializationException: Could not deserialize: autoType is not support. org.springframework.security.oauth2.provider.OAuth2Authentication; nested exception is com.alibaba.fastjson.JSONException: autoType is not support. org.springframework.security.oauth2.provider.OAuth2Authentication

反序列化内容(下述为测试数据敏感信息以作乱码处理):

{
	"@type": "org.springframework.security.oauth2.provider.OAuth2Authentication",
	"authenticated": true,
	"authorities": [],
	"clientOnly": false,
	"credentials": "",
	"name": "pangjiao",
	"oAuth2Request": {
		"approved": true,
		"authorities": Set[],
		"clientId": "webApp",
		"extensions": {
			"@type": "java.util.HashMap"
		},
		"grantType": "password",
		"refresh": false,
		"requestParameters": {
			"@type": "java.util.Collections$UnmodifiableMap",
			"validCode": "4gb2",
			"grant_type": "password",
			"scope": "app",
			"deviceId": "BD07208F-2A22-4675-9F2C-4F77A1BF7F4C",
			"client_id": "wepp",
			"username": "paniao"
		},
		"resourceIds": Set[],
		"responseTypes": Set[],
		"scope": ["app"]
	},
	"principal": {
		"@type": "com.open.capacity.common.auth.details.LoginUserDetails",
		"accountNonExpired": true,
		"accountNonLocked": true,
		"authenticationLoginUid": true,
		"authorities": Set[],
		"credentialsNonExpired": true,
		"enabled": true,
		"password": "$2a$10$Wtw81uu43saffGKw9asdfaflasfaasfakOr1RAOTNWxQIZBsB3YDwc/5yDnr/yeG5x92EG",
		"person": {
			"actUser": false,
			"address": "*****",
			"age": 28,
			"birthday": "1993-33-25",
			"cellphone": "13011111111",
			"contact": "北京XXXX",
			"createTime": "2020-03-31T20:46:39",
			"education": "XXX学历",
			"email": "123456@qq.com",
			"id": 9,
			"idCard": "580234199203251120",
			"lat": "",
			"lng": "",
			"name": "大爷",
			"namePinyin": "paniao",
			"nation": "汉族",
			"nativePlace": "打野市",
			"personPhotoUrls": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1584782933403&di=fbf9361f1aeaa995c021691783c9e7bb&imgtype=0&src=http%3A%2F%2Fnews.winshang.com%2Fmember%2FFCK%2F2020%2F3%2F3%2F202033153126407808x.jpg",
			"personStatus": "normal",
			"photo": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1584782933403&di=fbf9361f1aeaa995c021691783c9e7bb&imgtype=0&src=http%3A%2F%2Fnews.winshang.com%2Fmember%2FFCK%2F2020%2F3%2F3%2F202033153126407808x.jpg",
			"residenceCommunityCode": "001",
			"residenceCommunityName": "小区A",
			"residentialAddress": "重庆市渝中区XXXX",
			"school": "XXX大学",
			"sex": "woman",
			"speciality": "XXX专业",
			"unit": "测试单位",
			"updateTime": "2020-03-31T20:46:39",
			"workPhone": "13011111111"
		},
		"sysRoles": Set[],
		"tempUser": false,
		"type": "BACKEND",
		"user": {
			"cellphone": "13011111111",
			"createTime": "2020-03-31T20:54:42",
			"email": "112421@qq.com",
			"headImgUrl": "",
			"id": 35,
			"nickname": "打野",
			"personId": 9,
			"tempUser": false,
			"updateTime": "2020-03-31T20:54:42",
			"userStatus": "normal"
		},
		"userStatus": "normal",
		"username": "paniao"
	},
	"userAuthentication": {
		"@type": "org.springframework.security.authentication.UsernamePasswordAuthenticationToken",
		"authenticated": true,
		"authorities": [],
		"details": {
			"@type": "java.util.LinkedHashMap",
			"validCode": "4gb2",
			"grant_type": "password",
			"scope": "app",
			"client_secret": "wepp",
			"deviceId": "BD07208F-2A22-4675-9F2C-4F77A1BF7F4C",
			"client_id": "wepp",
			"username": "paniao"
		},
		"name": "paniao",
		"principal": {
			"$ref": "$.principal"
		}
	}
}

关联错误: #2600#2729

ngynwnxp

ngynwnxp1#

我还有遇到反序列化 String 类型变成 null!!!!!!!!!!!

相关问题