异常信息;

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 org.springframework.core.NestedIOException: Failed to deserialize object type; nested exception is java.lang.ClassNotFoundException: com.zzgele.qmkx.info.enums.InfomationTypeEnum
at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:84) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.serializer.SerializationUtils.deserializeValues(SerializationUtils.java:54) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.serializer.SerializationUtils.deserialize(SerializationUtils.java:68) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.core.AbstractOperations.deserializeValues(AbstractOperations.java:268) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.core.DefaultListOperations.lambda$range$6(DefaultListOperations.java:171) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at org.springframework.data.redis.core.DefaultListOperations.range(DefaultListOperations.java:171) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
at com.zzgele.qmkx.info.service.impl.InfomationServiceImpl.refreshInfo(InfomationServiceImpl.java:1116) ~[classes!/:0.0.1-SNAPSHOT]
at com.zzgele.qmkx.info.service.impl.InfomationServiceImpl.getVideoInfomationList(InfomationServiceImpl.java:881) ~[classes!/:0.0.1-SNAPSHOT]
at com.zzgele.qmkx.info.controller.InfomationController.getVideoInfomationList(InfomationController.java:375) ~[classes!/:0.0.1-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_172]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_172]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_172]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_172]
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 org.springframework.core.NestedIOException: Failed to deserialize object type; nested exception is java.lang.ClassNotFoundException: com.zzgele.qmkx.info.enums.InfomationTypeEnum
at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:78) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:36) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:82) ~[spring-data-redis-2.0.7.RELEASE.jar!/:2.0.7.RELEASE]
... 84 common frames omitted
Caused by: org.springframework.core.NestedIOException: Failed to deserialize object type; nested exception is java.lang.ClassNotFoundException: com.zzgele.qmkx.info.enums.InfomationTypeEnum
at org.springframework.core.serializer.DefaultDeserializer.deserialize(DefaultDeserializer.java:75) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:73) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
... 86 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.zzgele.qmkx.info.enums.InfomationTypeEnum
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_172]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_172]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93) ~[qmkx-service-info.jar:0.0.1-SNAPSHOT]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_172]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:274) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
at org.springframework.core.ConfigurableObjectInputStream.resolveClass(ConfigurableObjectInputStream.java:76) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1992) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568) ~[na:1.8.0_172]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571) ~[na:1.8.0_172]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) ~[na:1.8.0_172]
at org.springframework.core.serializer.DefaultDeserializer.deserialize(DefaultDeserializer.java:72) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
... 87 common frames omitted

1.问题原因

在缓存中存放新闻的数据,当从Redis中获取缓存的时候序列化报错。因为和另外一个服务用到了共同的枚举类,同事就把这个枚举类放到了公共的Common项目中,但是Redis中存贮着旧的数据。

Redis存贮的数据中带着类路径,所以JDK序列化的时候找不到这个类,就抛出Caused by: java.lang.ClassNotFoundException,把缓存清除一下。问题解决。

redis序列化异常------------org.springframework.data.redis.serializer.SerializationException的更多相关文章

  1. org.springframework.data.redis.serializer.SerializationException: Cannot serialize;

    前言 本文中提到的解决方案,源码地址在:perfect-ssm,希望可以帮你解决问题. 问题描述 在Spring与Redis整合过程中,出现了如下报错: org.springframework.dat ...

  2. Spring源码追踪1——doGetBean(为什么org.springframework.data.redis.core.RedisTemplate的实例可以注入为ListOperations)

    类org.springframework.beans.factory.support.AbstractBeanFactory方法T doGetBean(final String name, final ...

  3. Consider defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration

    Description: Parameter 0 of method redisTemplate in com.liaojie.cloud.auth.server.config.redis.Redis ...

  4. org.springframework.data.redis.cache.RedisCacheManager

    org.springframework.data.redis.cache.RedisCacheManager

  5. SpringBoot- springboot集成Redis出现报错:No qualifying bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory'

    Springboot将accessToke写入Redisk 缓存,springboot集成Redis出现报错 No qualifying bean of type 'org.springframewo ...

  6. Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

    *************************** APPLICATION FAILED TO START *************************** Description: Fie ...

  7. Parameter 0 of method redisTemplate in org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactor

    Error starting ApplicationContext. To display the conditions report re-run your application with 'de ...

  8. org.springframework.data.redis.RedisConnectionFailureException

    org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested ...

  9. 解决 Spring Oauth2 RedisTokenStore storeAccessToken 报错 java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.set

    原因是Spring 版本兼容问题 参考: https://blog.csdn.net/smollsnail/article/details/78954225 继承 RedisTokenStore 修改 ...

随机推荐

  1. 免安装版本Mysql配置

    免安装版本mysql配置如下:(本人使用的是5.6.42) 1. 解压后将/bin目录配置在系统变量中 2. 在mysql目录下新建my.ini文件配置如下信息: [mysqld] basedir=D ...

  2. WPF简单数据绑定

    XAML: <!--#region 数据绑定控件--> <DataGrid x:Name="dataGrid" Grid.Column="2" ...

  3. 关于xampp默认安装后mysql/mariadb密码的修改

    关于xampp默认按照后mysql/mariadb密码的修改 默认安装的mysql/mariadb 是没有密码的 只能跳过  然后进行修改密码 /opt/lampp/bin/mysqld_safe - ...

  4. a.每个 HTML 文件里开头都有个<!DOCTYPE>

    <!DOCTYPE> 位于文档中最前面的位置,告诉浏览器以哪个HTML版本进行解析. 在 HTML5 中只有一种:<!DOCTYPE html> .

  5. <转载>Bootstrap 入门教程 http://www.cnblogs.com/ventlam/archive/2012/05/28/2520703.html 系列

    Bootstrap建立了一个响应式的12列格网布局系统,它引入了fixed和fluid-with两种布局方式.我们从全局样式(Global Style),格网系统(Grid System),流式格网( ...

  6. JavaScript数组的五个迭代方法的简单实例

    <script> //every() var nums = [1,2,3,4,5]; var result = nums.every(function eve(item,index,arr ...

  7. AspxGridView使用手记

    AspxGridView使用手记   一.  基本使用方法  4 1.导入Dll文件   4 2.Asp.Net页面控件注册 4 3. Asp.Net页面控件声明    5 4.删除licenses. ...

  8. JVM虚拟机宕机_java.lang.OutOfMemoryError: unable to create new native thread

    原因:当前用户的系统最最大程序数数已达到最大值,使用ulimit -u可以看到是1024   解决办法:在当前用户下使用ulimit -u 65535 然后再执行jsp,一切ok     功能说明:控 ...

  9. react-native ios打包 、设置图标 启动图片

    在这里只记录xcode 打包操作,申请证书操作,之前已经记录过了. https://www.cnblogs.com/hellovoidworld/p/4127576.html  参考了这篇文章,只是可 ...

  10. J2SE 8的流库 --- 生成流

    本文介绍了如何产生J2SE 8的流, 包括基本类型的流IntStream, LongStream, DoubleStream . 展现流的方法 public static <T> void ...