title: Error creating bean with name '...RedisHttpSessionConfiguration': Initialization of bean failed
body: <p>I'm using Redis and created <code>HttpSessionConfig</code> file. Here is my code in </p>
  
  <p><strong><code>HttpSessionConfig.java</code>:</strong></p>
  
  <pre><code>@EnableRedisHttpSession
  public class HttpSessionConfig {
  
      @Bean
      public LettuceConnectionFactory connectionFactory() {
  
          return new LettuceConnectionFactory();
      }
  
      @Bean
      public HttpSessionIdResolver httpSessionStrategy() {
          return HeaderHttpSessionIdResolver.authenticationInfo();
      }
  
  }
  </code></pre>
  
  <p>And here is my <code>pom.xml</code> file:</p>
  
  <pre><code>    &lt;!-- Redis --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.session&lt;/groupId&gt;
          &lt;artifactId&gt;spring-session-data-redis&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;biz.paluch.redis&lt;/groupId&gt;
          &lt;artifactId&gt;lettuce&lt;/artifactId&gt;
          &lt;version&gt;4.3.1.Final&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>But I got error: </p>
  
  <blockquote>
  <pre><code>Error creating bean with name 'org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration':
  </code></pre>
    
    <p>Initialization of bean failed</p>
  </blockquote>
  
  <p>More trace:</p>
  
  <blockquote>
    <p>Caused by:
    org.springframework.beans.factory.UnsatisfiedDependencyException:
    Error creating bean with name 'sessionRepositoryFilterRegistration'
    defined in class path resource
    [org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.class]:
    Unsatisfied dependency expressed through method
    'sessionRepositoryFilterRegistration' parameter 1; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name
    'org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration':
    Initialization of bean failed; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'connectionFactory' defined in class path
    resource [bookstore/config/HttpSessionConfig.class]: Bean
    instantiation via factory method failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory]:
    Factory method 'connectionFactory' threw exception; nested exception
    is java.lang.NoClassDefFoundError: io/lettuce/core/KeyValue</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error
  </code></pre>
    
    <p>creating bean with name
    'org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration':
    Initialization of bean failed; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'connectionFactory' defined in class path
    resource [bookstore/config/HttpSessionConfig.class]: Bean
    instantiation via factory method failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory]:
    Factory method 'connectionFactory' threw exception; nested exception
    is java.lang.NoClassDefFoundError: io/lettuce/core/KeyValue</p>
  </blockquote>
  
  <p>Anyone know how to fix it ???</p>