springboot引入spring-boot-starter-data-redis启动报错

	Springboot中使用redis引用了spring-boot-starter-data-redis,结
果项目无法启动 , 错误如下  
Caused by: java.lang.ClassNotFoundException: 
redis.clients.jedis.Tuple
![在这里插入图片描述](https://img-blog.csdnimg.cn/d95a4733221545a0a158dc3a40b271aa.jpeg#pic_center)

错误原文

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.3.jar:5.3.3]
	... 48 common frames omitted
Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
	at org.springframework.data.redis.connection.jedis.JedisConverters.<clinit>(JedisConverters.java:133) ~[spring-data-redis-2.4.3.jar:2.4.3]
	at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.<clinit>(JedisConnectionFactory.java:87) ~[spring-data-redis-2.4.3.jar:2.4.3]
	at RedisConfig.redisConnectionFactory(RedisConfig.java:60) ~[classes/:na]
	at RedisConfig$$EnhancerBySpringCGLIB$$68aafdc2.CGLIB$redisConnectionFactory$1(<generated>) ~[classes/:na]
	at RedisConfig$$EnhancerBySpringCGLIB$$68aafdc2$$FastClassBySpringCGLIB$$2c479cfa.invoke(<generated>) ~[classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.3.jar:5.3.3]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.3.jar:5.3.3]
	at RedisConfig$$EnhancerBySpringCGLIB$$68aafdc2.redisConnectionFactory(<generated>) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_312]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_312]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_312]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_312]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.3.jar:5.3.3]
	... 49 common frames omitted
Caused by: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
	... 62 common frames omitted
Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.Tuple
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[na:1.8.0_312]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_312]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[na:1.8.0_312]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_312]
	... 62 common frames omitted

2022-06-27 14:10:59.202  WARN 33780 --- [      Thread-11] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Start destroying Publisher
2022-06-27 14:10:59.203  WARN 33780 --- [       Thread-5] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Start destroying common HttpClient
2022-06-27 14:10:59.203  WARN 33780 --- [      Thread-11] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Destruction of the end
2022-06-27 14:10:59.203  WARN 33780 --- [       Thread-5] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Destruction of the end

Process finished with exit code 1

解决方案:


<dependency>
    <groupId>redis.clientsgroupId>
    <artifactId>jedisartifactId>
    <version>2.7.1version>
dependency>

你可能感兴趣的:(奇奇怪怪的报错,redis,spring,boot)