title: Caused by: java.lang.ClassNotFoundException: org.springframework.data.redis.connection.RedisClusterConfiguration
body: <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/data/redis/connection/RedisClusterConfiguration
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.getDeclaredMethods(Class.java:1975)
      at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
      at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
      at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
      at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:570)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:697)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:640)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:515)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:508)
      at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1189)
      at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:862)
      at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:848)
      at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:834)
      at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:788)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
      at com.example.RedisCacheExample.RedisCacheExampleApplication.main(RedisCacheExampleApplication.java:13)
  Caused by: java.lang.ClassNotFoundException: org.springframework.data.redis.connection.RedisClusterConfiguration
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 24 more
  </code></pre>
  
  <p>////////</p>
  
  <pre><code>package config;
  
  /**
   * Created by desmond on 15/5/2017.
   */
  
  import org.springframework.cache.CacheManager;
  import org.springframework.cache.annotation.CachingConfigurerSupport;
  import org.springframework.cache.annotation.EnableCaching;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.data.redis.cache.RedisCacheManager;
  import org.springframework.data.redis.connection.RedisConnectionFactory;
  import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
  import org.springframework.data.redis.core.RedisTemplate;
  
  @Configuration
  @EnableCaching
  public class CacheConfig extends CachingConfigurerSupport {
  
      @Bean
      public JedisConnectionFactory redisConnectionFactory() {
          JedisConnectionFactory redisConnectionFactory = new JedisConnectionFactory();
  
          // Defaults
          redisConnectionFactory.setHostName("127.0.0.1");
          redisConnectionFactory.setPort(6379);
          return redisConnectionFactory;
      }
  
      @Bean
      public RedisTemplate&lt;String, String&gt; redisTemplate(RedisConnectionFactory cf) {
          RedisTemplate&lt;String, String&gt; redisTemplate = new RedisTemplate&lt;String, String&gt;();
          redisTemplate.setConnectionFactory(cf);
          return redisTemplate;
      }
  
      @Bean
      public CacheManager cacheManager(RedisTemplate redisTemplate) {
          RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate);
  
          // Number of seconds before expiration. Defaults to unlimited (0)
          cacheManager.setDefaultExpiration(300);
          return cacheManager;
      }
  }
  </code></pre>
  
  <p>I am trying spring with redis. I followed a tutorial online but it is giving this error. I have downloaded redis and it is running in my background. What am i doing wrong here? I have included the error above and the redis code. please help me thank you. The pom file is added below</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;RedisCacheExample&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;RedisCacheExample&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.5.3.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-redis&lt;/artifactId&gt;
              &lt;version&gt;1.6.2.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;redis.clients&lt;/groupId&gt;
              &lt;artifactId&gt;jedis&lt;/artifactId&gt;
              &lt;version&gt;2.5.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>