gateway使用获取CacheUtil存储的数据

Blade 未结 1 933
BovenRaye
BovenRaye 剑童 2020-11-23 10:32

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

1. 在system用CacheUtil存入信息

2. 在gateway取出来

3.


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

期待正常取出来,实际用到的是逆序号出错

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

2.6.0  企业授权版  window10

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

image.png

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

org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.StreamCorruptedException: invalid stream header: 0B4A0773

at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:84) ~[spring-data-redis-2.1.19.RELEASE.jar:2.1.19.RELEASE]

at org.springframework.data.redis.serializer.DefaultRedisElementReader.read(DefaultRedisElementReader.java:48) ~[spring-data-redis-2.1.19.RELEASE.jar:2.1.19.RELEASE]

at org.springframework.data.redis.serializer.RedisSerializationContext$SerializationPair.read(RedisSerializationContext.java:226) ~[spring-data-redis-2.1.19.RELEASE.jar:2.1.19.RELEASE]

at org.springframework.data.redis.cache.RedisCache.deserializeCacheValue(RedisCache.java:260) ~[spring-data-redis-2.1.19.RELEASE.jar:2.1.19.RELEASE]

at org.springframework.data.redis.cache.RedisCache.lookup(RedisCache.java:94) ~[spring-data-redis-2.1.19.RELEASE.jar:2.1.19.RELEASE]

at org.springframework.cache.support.AbstractValueAdaptingCache.get(AbstractValueAdaptingCache.java:58) ~[spring-context-5.1.17.RELEASE.jar:5.1.17.RELEASE]

at org.springblade.gateway.util.CacheUtil.get(CacheUtil.java:75) ~[classes/:na]

at org.springblade.gateway.filter.ResponseParameterEncryptGlobalFilter$1.lambda$writeWith$0(ResponseParameterEncryptGlobalFilter.java:68) ~[classes/:na]

at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100) [reactor-core-3.2.19.RELEASE.jar:3.2.19.RELEASE]

at reactor.core.publisher.FluxBuffer$BufferExactSubscriber.onComplete(FluxBuffer.java:183) ~[reactor-core-3.2.19.RELEASE.jar:3.2.19.RELEASE]

at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136) [reactor-core-3.2.19.RELEASE.jar:3.2.19.RELEASE]

at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:252) ~[reactor-core-3.2.19.RELEASE.jar:3.2.19.RELEASE]

at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136) [reactor-core-3.2.19.RELEASE.jar:3.2.19.RELEASE]

at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:426) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:210) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:368) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:370) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:419) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:598) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:92) ~[reactor-netty-0.8.20.RELEASE.jar:0.8.20.RELEASE]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[netty-codec-4.1.51.Final.jar:4.1.51.Final]

at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[netty-codec-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[netty-transport-4.1.51.Final.jar:4.1.51.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.51.Final.jar:4.1.51.Final]

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.51.Final.jar:4.1.51.Final]

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.51.Final.jar:4.1.51.Final]

at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]

Caused by: org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.StreamCorruptedException: invalid stream header: 0B4A0773

at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:78) ~[spring-core-5.1.17.RELEASE.jar:5.1.17.RELEASE]

at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:36) ~[spring-core-5.1.17.RELEASE.jar:5.1.17.RELEASE]

at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:82) ~[spring-data-redis-2.1.19.RELEASE.jar:2.1.19.RELEASE]

... 42 common frames omitted

Caused by: java.io.StreamCorruptedException: invalid stream header: 0B4A0773

at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:866) ~[na:1.8.0_181]

at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358) ~[na:1.8.0_181]

at org.springframework.core.ConfigurableObjectInputStream.<init>(ConfigurableObjectInputStream.java:65) ~[spring-core-5.1.17.RELEASE.jar:5.1.17.RELEASE]

at org.springframework.core.ConfigurableObjectInputStream.<init>(ConfigurableObjectInputStream.java:51) ~[spring-core-5.1.17.RELEASE.jar:5.1.17.RELEASE]

at org.springframework.core.serializer.DefaultDeserializer.deserialize(DefaultDeserializer.java:70) ~[spring-core-5.1.17.RELEASE.jar:5.1.17.RELEASE]

at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:73) ~[spring-core-5.1.17.RELEASE.jar:5.1.17.RELEASE]

... 44 common frames omitted



1条回答
提交回复