3.0.1.RELEASE 希望升级到 4.2.0.RELEASE ,获取 redis 数据的时候报错

Blade 未结 1 113
houlinan08
houlinan08 2024-11-01 12:13

一、该问题的重现步骤是什么?

  1. 使用4.2.0.RELEASE   版本,读取 3.0.1.RELEASE  的 redis 数据的时候, 报错:

    image.png



二、你期待的结果是什么?实际看到的又是什么?

因为我们系统的 redis 缓存数据比较重要。有没有什么方法能让我使用新的 4.2.0.RELEASE 版本,可以无感不报错的获取到历史 redis 数据,  

我看了论坛的其他用户的反馈,也有同样的问题, 如果让我 redis 清空可能不太行,因为里面保存了很多重要数据



三、你正在使用的是什么产品,什么版本?在什么操作系统上?

本地


四、请提供详细的错误堆栈信息,这很重要。


2024-11-01 12:10:57.123 ERROR 58275 --- [  XNIO-1 task-2] o.s.c.l.e.BladeRestExceptionTranslator   : 服务器异常


java.lang.RuntimeException: Reading from a byte array threw an IOException (should never happen).

at io.protostuff.IOUtil.mergeFrom(IOUtil.java:54)

at io.protostuff.ProtostuffIOUtil.mergeFrom(ProtostuffIOUtil.java:104)

at org.springblade.core.redis.serializer.ProtoStuffSerializer.deserialize(ProtoStuffSerializer.java:59)

at org.springframework.data.redis.serializer.DefaultRedisElementReader.read(DefaultRedisElementReader.java:46)

at org.springframework.data.redis.serializer.RedisSerializationContext$SerializationPair.read(RedisSerializationContext.java:277)

at org.springframework.data.redis.cache.RedisCache.deserializeCacheValue(RedisCache.java:390)

at org.springframework.data.redis.cache.RedisCache.lookup(RedisCache.java:209)

at org.springframework.cache.support.AbstractValueAdaptingCache.get(AbstractValueAdaptingCache.java:58)

at org.springblade.core.cache.utils.CacheUtil.get(CacheUtil.java:219)

at org.springblade.core.cache.utils.CacheUtil.get(CacheUtil.java:197)

at org.springblade.common.cache.ParamCache.getValue(ParamCache.java:68)

at org.springblade.modules.auth.handler.BladeAuthorizationHandler.validateFailCount(BladeAuthorizationHandler.java:211)

at org.springblade.modules.auth.handler.BladeAuthorizationHandler.preValidation(BladeAuthorizationHandler.java:90)

at org.springblade.core.oauth2.endpoint.OAuth2TokenEndPoint.token(OAuth2TokenEndPoint.java:103)

at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

at java.base/java.lang.reflect.Method.invoke(Method.java:580)

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255)

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)

at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)

at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)

at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

at org.springblade.core.log.filter.LogTraceFilter.doFilter(LogTraceFilter.java:48)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springblade.core.boot.request.BladeRequestFilter.doFilter(BladeRequestFilter.java:67)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at com.alibaba.druid.support.jakarta.WebStatFilter.doFilter(WebStatFilter.java:113)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:142)

at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:82)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:362)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:278)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:395)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)

at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)

at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)

at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)

at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)

at java.base/java.lang.Thread.run(Thread.java:1570)

Caused by: io.protostuff.ProtobufException: Protocol message contained an invalid tag (zero).

at io.protostuff.ProtobufException.invalidTag(ProtobufException.java:106)

at io.protostuff.ByteArrayInput.readFieldNumber(ByteArrayInput.java:253)

at io.protostuff.runtime.ObjectSchema.readObjectFrom(ObjectSchema.java:443)

at io.protostuff.runtime.ObjectSchema.mergeFrom(ObjectSchema.java:351)

at io.protostuff.ByteArrayInput.mergeObjectEncodedAsGroup(ByteArrayInput.java:518)

at io.protostuff.ByteArrayInput.mergeObject(ByteArrayInput.java:490)

at io.protostuff.runtime.RuntimeUnsafeFieldFactory$15$1.mergeFrom(RuntimeUnsafeFieldFactory.java:1229)

at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:466)

at io.protostuff.IOUtil.mergeFrom(IOUtil.java:45)

... 87 common frames omitted


五、若有更多详细信息,请在下面提供。

1条回答
  •  admin
    admin (楼主)
    2024-11-01 12:43

    版本跨越的有点多,应该有不少bladex的entity有字段变动。如果有字段变动的话,redis序列化就会报错的。

    你可以把bladex系统不重要的缓存清掉(清理之前建议先做个备份),保留你自己重要的业务缓存,然后再登录看看。

    0 讨论(0)
提交回复