0

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 ?

yimson
  • 49
  • 2
  • 14
  • 1
    from the exception it looks like you're missing a dependency in your project: `java.lang.NoClassDefFoundError: reactor/core/scheduler/Scheduler`. A quick search for the class indicates that the reactor-core dependency is the one that seems missing – Christian Triebstein Jun 13 '18 at 19:16
  • @ChristianTriebstein, you were right. I had to add the following dependency `io.projectreactor reactor-core 3.1.8.RELEASE ` And Everything works fine now. – yimson Jun 14 '18 at 14:50

1 Answers1

2

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.

yimson
  • 49
  • 2
  • 14
  • `projectreactor` is already included in `lettuce.core` https://mvnrepository.com/artifact/io.lettuce/lettuce-core/5.2.2.RELEASE. IDT we have to included it separately? – roottraveller Apr 07 '20 at 05:50