spring-data-redis 和 jedis整合问题

java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.autoconfigure.data.redis.JedisConnectionConfiguration] from ClassLoader [sun.misc.Launcher A p p C l a s s L o a d e r @ 18 b 4 a a c 2 ] a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 481 )   [ s p r i n g − c o r e − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . d o W i t h M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 358 )   [ s p r i n g − c o r e − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t U n i q u e D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 414 )   [ s p r i n g − c o r e − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . l a m b d a AppClassLoader@18b4aac2] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:358) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:414) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda AppClassLoader@18b4aac2]atorg.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481) [springcore5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:358) [springcore5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:414) [springcore5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambdagetTypeForFactoryMethod 2 ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 743 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t j a v a . u t i l . c o n c u r r e n t . C o n c u r r e n t H a s h M a p . c o m p u t e I f A b s e n t ( C o n c u r r e n t H a s h M a p . j a v a : 1688 )   [ n a : 1.8. 0 9 1 ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . g e t T y p e F o r F a c t o r y M e t h o d ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 742 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d e t e r m i n e T a r g e t T y p e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 681 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p r e d i c t B e a n T y p e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 649 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . i s F a c t o r y B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 1605 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . d o G e t B e a n N a m e s F o r T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 523 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . g e t B e a n N a m e s F o r T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 494 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . g e t B e a n s O f T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 616 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . g e t B e a n s O f T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 608 )   [ s p r i n g − b e a n s − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . g e t B e a n s O f T y p e ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 1242 )   [ s p r i n g − c o n t e x t − 5.2.5. R E L E A S E . j a r : 5.2.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . g e t E x i t C o d e F r o m M a p p e d E x c e p t i o n ( S p r i n g A p p l i c a t i o n . j a v a : 869 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . g e t E x i t C o d e F r o m E x c e p t i o n ( S p r i n g A p p l i c a t i o n . j a v a : 857 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . h a n d l e E x i t C o d e ( S p r i n g A p p l i c a t i o n . j a v a : 844 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . h a n d l e R u n F a i l u r e ( S p r i n g A p p l i c a t i o n . j a v a : 795 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 325 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1226 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1215 ) [ s p r i n g − b o o t − 2.2.6. R E L E A S E . j a r : 2.2.6. R E L E A S E ] a t c o m . e x a m p l e . d e m o . D e m o A p p l i c a t i o n . m a i n ( D e m o A p p l i c a t i o n . j a v a : 10 ) [ c l a s s e s / : n a ] C a u s e d b y : j a v a . l a n g . N o C l a s s D e f F o u n d E r r o r : o r g / s p r i n g f r a m e w o r k / d a t a / r e d i s / c o n n e c t i o n / j e d i s / J e d i s C l i e n t C o n f i g u r a t i o n 2(AbstractAutowireCapableBeanFactory.java:743) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[na:1.8.0_91] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:742) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:681) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:649) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1605) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:523) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:494) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:616) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:608) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1242) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE] at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:869) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:857) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:844) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:795) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at com.example.demo.DemoApplication.main(DemoApplication.java:10) [classes/:na] Caused by: java.lang.NoClassDefFoundError: org/springframework/data/redis/connection/jedis/JedisClientConfiguration 2(AbstractAutowireCapableBeanFactory.java:743) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atjava.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) [na:1.8.091]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:742) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:681) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:649) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1605) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:523) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:494) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:616) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:608) [springbeans5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1242) [springcontext5.2.5.RELEASE.jar:5.2.5.RELEASE]atorg.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:869)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atorg.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:857)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atorg.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:844)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atorg.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:795)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:325)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1226)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1215)[springboot2.2.6.RELEASE.jar:2.2.6.RELEASE]atcom.example.demo.DemoApplication.main(DemoApplication.java:10)[classes/:na]Causedby:java.lang.NoClassDefFoundError:org/springframework/data/redis/connection/jedis/JedisClientConfigurationJedisClientConfigurationBuilder
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_91]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_91]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_91]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
… 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.data.redis.connection.jedis.JedisClientConfiguration J e d i s C l i e n t C o n f i g u r a t i o n B u i l d e r a t j a v a . n e t . U R L C l a s s L o a d e r . f i n d C l a s s ( U R L C l a s s L o a d e r . j a v a : 381 )   [ n a : 1.8. 0 9 1 ] a t j a v a . l a n g . C l a s s L o a d e r . l o a d C l a s s ( C l a s s L o a d e r . j a v a : 424 )   [ n a : 1.8. 0 9 1 ] a t s u n . m i s c . L a u n c h e r JedisClientConfigurationBuilder at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_91] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_91] at sun.misc.Launcher JedisClientConfigurationBuilderatjava.net.URLClassLoader.findClass(URLClassLoader.java:381) [na:1.8.091]atjava.lang.ClassLoader.loadClass(ClassLoader.java:424) [na:1.8.091]atsun.misc.LauncherAppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_91]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_91]
… 25 common frames omitted

原因是因为jar包冲突

换成下面这个就好了

<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-redis</artifactId>
			<version>1.8.1.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
		<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>2.9.0</version>
		</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值