Leon
Leon

Because my github cannot send pictures, the error message is as follows: clean -> install org.bimserver.shared.exceptions.UserException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect at org.bimserver.shared.json.JsonReflector.callMethod(JsonReflector.java:120) at org.bimserver.generated.AuthInterfaceImplrQJiuMoqiyQS_1.login(AuthInterfaceImplrQJiuMoqiyQS_1.java)...
I am building from the parent class of maven. I now want to type it into a jar locally and run it. However, I have been failing to package through...
Thank you, I will give it a try
> 我用springboot的devtools热部署,也有遇到ClassCastException,但这并不是fastjson之类的bug,其他的库也会有这个错,ehcache也会遇到这个错。如果你也是用了devtools就有异常,不用就没异常,那具体可看spring官网的解决方案:https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools.restart.customizing-the-classload 目前我没有使用devtools,我只要是从redis读取进行强转,所有类都会提示这个异常 T t = (T)redisTemplate.opsForValue().get("key")
> @uhleon 使用`GenericFastJsonRedisSerializer`试试 see https://github.com/alibaba/fastjson2/blob/main/docs/spring_support_cn.md#41-generic-redis-serializer 我非常感谢您的回复,我使用了提供的两种方案去序列化redis  FastJsonRedisSerializer 提示的异常是和上述异常一致的,我复现了很多次,感觉好像是指定Object.class的问题 GenericFastJsonRedisSerializer 提示的异常为下述 
@VictorZeng 我已经自定义配置完白名单  但是我如果使用 JSON.toJSONBytes(t, JSONWriter.Feature.WriteClassName); 去序列化Json到redis的时候,他已经是一个错误的JSON格式,并不能格式化  序列后的数据,您可尝试回显一下 {"@type":"org.springframework.security.oauth2.server.authorization.OAuth2Authorization","attributes":{"@type":"java.util.Collections$UnmodifiableMap","java.security.Principal":{"@type":"org.springframework.security.authentication.UsernamePasswordAuthenticationToken","authenticated":true,"authorities":[{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_admin"},{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_user"}],"details":{"@type":"org.springframework.security.web.authentication.WebAuthenticationDetails","remoteAddress":"127.0.0.1","sessionId":"29584A209FD143DB24C36708547E7A87"},"name":"leon","principal":{"@type":"com.uhbro.whale.dto.AuthUserDto","accountNonExpired":true,"accountNonLocked":true,"attributes":{"@type":"java.util.HashMap"},"authorities":Set[{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_admin"},{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_user"}],"credentialsNonExpired":true,"email":"[email protected]","enabled":true,"name":"leon","nickname":"leon","phone":"18137772224","userId":1,"username":"leon"}},"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@type":"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest","additionalParameters":{"@type":"java.util.Collections$UnmodifiableMap"},"attributes":{"@type":"java.util.Collections$UnmodifiableMap"},"authorizationRequestUri":"http://127.0.0.1:9000/whale/oauth2/authorize?response_type=code&client_id=web&scope=all&redirect_uri=https://www.baidu.com","authorizationUri":"http://127.0.0.1:9000/whale/oauth2/authorize","clientId":"web","grantType":{"value":"authorization_code"},"redirectUri":"https://www.baidu.com","responseType":{"value":"code"},"scopes":Set["all"]},"state":"ITbg4w8iUSHwaFbRmFTu8es9CfFSAMQg6oZEq3fwH4Y="},"authorizationGrantType":{"value":"authorization_code"},"id":"29546756-a176-463c-8dd6-e4f675e20d8a","principalName":"leon","registeredClientId":"web"} 异常信息 
@VictorZeng 我尝试了您提供的方法,但是还是未能解决问题,现在我有一个疑问,当我配置redis的时候 如下  当我指定泛型为Object.class 就不可以反序列化Bean了 复现代码:   异常信息:  是我哪里方法用的有错误吗