Reputation: 49
I'm trying to autowire the ClientResources as it is showing below:
@Bean(destroyMethod = "shutdown")
public ClientResources clientResources() {
final ClientResources res = DefaultClientResources.create();
return res;
}
But I'm facing the following issue:
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
Can someone please help me to figure out this issue ?
Upvotes: 0
Views: 2179
Reputation: 49
I added the following dependency :
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.1.8.RELEASE</version>
</dependency>
Everything is okay now.
Upvotes: 2