gpt4 book ai didi

spring-boot - 尝试 Autowiring ClientResources 时出现问题

转载 作者:可可西里 更新时间:2023-11-01 11:15:15 25 4
gpt4 key购买 nike

我正在尝试 Autowiring ClientResources,如下所示:

@Bean(destroyMethod = "shutdown") 
public ClientResources clientResources() {
final ClientResources res = DefaultClientResources.create();
return res;
}

但我面临以下问题:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientResources' defined in class path resource [com/xxx/xxx/xxx/configuration/CacheLettuceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.lettuce.core.resource.ClientResources]: Factory method 'clientResources' threw exception; nested exception is java.lang.NoClassDefFoundError: reactor/core/scheduler/Schedulers

有人可以帮我解决这个问题吗?

最佳答案

我添加了以下依赖:

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.1.8.RELEASE</version>
</dependency>

现在一切正常

关于spring-boot - 尝试 Autowiring ClientResources 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50843671/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com