当我像这样强迫绝地武士使用build.gradle
的最新版本4.2.3时:
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'redis.clients' && details.requested.name == 'jedis' ) {
details.useVersion("4.2.3")
}
}
}
显示如下错误:
Caused by: java.lang.NoClassDefFoundError: redis.clients.jedis.GeoUnit
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.<clinit>(JedisConnectionFactory.java:93) ~[spring-data-redis-2.6.4.jar!/:2.6.4]
at org.springframework.boot.autoconfigure.data.redis.JedisConnectionConfiguration.createJedisConnectionFactory(JedisConnectionConfiguration.java:74) ~[spring-boot-autoconfigure-2.6.7.jar!/:2.6.7]
at org.springframework.boot.autoconfigure.data.redis.JedisConnectionConfiguration.redisConnectionFactory(JedisConnectionConfiguration.java:62) ~[spring-boot-autoconfigure-2.6.7.jar!/:2.6.7]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.19.jar!/:5.3.19]
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$316/0x0000000070e22f90.getObject(Unknown Source) ~[?:?]
我想使用绝地武士的消费功能,似乎弹簧启动数据与最新的绝地武士不兼容。有可能解决这个问题吗?
简短的回答,否
有一些用户[1][2][3]正在使用绝地武士4,但这是可能的,如果你不使用某些功能,并愿意通过一些额外的工作。
顺便说一句,spring-data-redis正在升级他们对jedi 4的支持。也许,您可以等待这次升级。