SpringBoot 引入Jedis 报错:NoClassDefFoundError: redis/clients/util/SafeEncoder

错误详情:

Caused by: java.lang.NoClassDefFoundError: redis/clients/util/SafeEncoder
	at org.springframework.data.redis.connection.jedis.JedisConverters.lambda$static$1(JedisConverters.java:127) ~[spring-data-redis-2.1.10.RELEASE.jar:2.1.10.RELEASE]
	at org.springframework.data.redis.connection.jedis.JedisConverters.toBytes(JedisConverters.java:342) ~[spring-data-redis-2.1.10.RELEASE.jar:2.1.10.RELEASE]
	at org.springframework.data.redis.connection.jedis.JedisConverters.(JedisConverters.java:134) ~[spring-data-redis-2.1.10.RELEASE.jar:2.1.10.RELEASE]
	at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.(JedisConnectionFactory.java:86) ~[spring-data-redis-2.1.10.RELEASE.jar:2.1.10.RELEASE]
	at com.zit.springsecurity.configuration.HttpSessionConfig.connectionFactory(HttpSessionConfig.java:21) ~[classes/:na]
	at com.zit.springsecurity.configuration.HttpSessionConfig$$EnhancerBySpringCGLIB$$6f2c67ff.CGLIB$connectionFactory$1() ~[classes/:na]
	at com.zit.springsecurity.configuration.HttpSessionConfig$$EnhancerBySpringCGLIB$$6f2c67ff$$FastClassBySpringCGLIB$$32c6916e.invoke() ~[classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
	at com.zit.springsecurity.configuration.HttpSessionConfig$$EnhancerBySpringCGLIB$$6f2c67ff.connectionFactory() ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_221]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_221]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
	... 95 common frames omitted
Caused by: java.lang.ClassNotFoundException: redis.clients.util.SafeEncoder
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_221]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_221]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_221]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_221]
	... 110 common frames omitted

解决方法

降低Jedis版本


	redis.clients
	jedis
	2.9.0

你可能感兴趣的:(Redis)