ClassNotFoundException: redis.clients.jedis.util.SafeEncoder

redis配置工厂报错

Caused by: java.lang.NoClassDefFoundError: redis/clients/util/SafeEncoder
    at org.springframework.data.redis.connection.jedis.JedisConverters.lambda$static$1(JedisConverters.java:127)
    at org.springframework.data.redis.connection.jedis.JedisConverters.toBytes(JedisConverters.java:342)
    at org.springframework.data.redis.connection.jedis.JedisConverters.<clinit>(JedisConverters.java:134)
    at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.<clinit>(JedisConnectionFactory.java:86)
    at com.dongriaf.framework.config.redis.RedisConfig.redisConnectionFactory(RedisConfig.java:80)
    at com.dongriaf.framework.config.redis.RedisConfig$$EnhancerBySpringCGLIB$$586d20c4.CGLIB$redisConnectionFactory$4(<generated>)
    at com.dongriaf.framework.config.redis.RedisConfig$$EnhancerBySpringCGLIB$$586d20c4$$FastClassBySpringCGLIB$$cc5a24ea.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
    at com.dongriaf.framework.config.redis.RedisConfig$$EnhancerBySpringCGLIB$$586d20c4.redisConnectionFactory(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 113 common frames omitted
Caused by: java.lang.ClassNotFoundException: redis.clients.util.SafeEncoder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 128 common frames omitted

这个类没有,我之前用的是

<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
这个包中是没有redis/clients/util/SafeEncoder路径的。
高版本中才会有

 

 我用的jedis版本是3.3的就好了

 

posted on 2020-09-03 23:00  淡淡人生过  阅读(6435)  评论(0编辑  收藏  举报

导航