- Error Message
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘redissonController’: Unsatisfied dependency expressed through field ‘stringRedisTemplate’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘stringRedisTemplate’ defined in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘stringRedisTemplate’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘redisConnectionFactory’ defined in class path resource [org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method ‘redisConnectionFactory’ threw exception; nested exception is java.lang.NoClassDefFoundError: redis/clients/util/SafeEncoder
2. Solution
springboot2.1.5 jedis3.3.0 The main reason is that jedis and spring-boot-starter-data-redis are not compatible with the version of the maven dependency, which is a frequent problem. The same is true for JedisConnectionFactory, which cannot be created. Changing to the following version will solve the problem
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.1</version>
</dependency>
Read More:
- Error creating bean with name ‘redistemplate’ defined in class path resource
- [Solved] Springboot Error creating bean with name ‘dataSource’ defined in class path resource
- [Solved] nacos Startup Error: Error creating bean with name ‘authFilterRegistration‘ defined in class path resource
- [Solved] Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource
- SpringBoot Access Clickhouse Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘jdbcConverter’ defined in class path resource [***.class]
- When integrating redis with SSM framework, error creating bean with name ‘rediscontentserviceimpl’ defined in file
- [Solved] Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer‘ defined in class path
- [Solved] Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer‘ defined in class path re
- [Solved] Error creating bean with name ‘braveHttpServerHandler‘ defined in class path
- Error creating bean with name ‘studentMapper‘ defined in file
- Tk.mapper Common mapper Error: Error creating bean with name ‘commonMapper‘ defined in file xxx
- Error creating bean with name ‘captchaController‘: Unsatisfied dependency expressed through field ‘c
- Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…
- [Solved] JWT + SSO Error: Error creating bean with name ‘jwtTokenServices’
- How to Solve creating bean with name ‘mappingjackson2httpmessageconverter’ error when elasticsearch advanced client starts‘
- [Solved] Error creating bean with name rController‘: Unsatisfied dependency expressed through field
- [Solved] Notwritablepropertyexception: invalid property ‘mapperhelper’ of bean class
- Spring cloud Eureka error creating bean with name
- [Solved] renren-fast Startup Error: Error creating bean with name ‘scheduleJobController‘
- [Solved] Maven log jar package conflict error: Class path contains multiple SLF4J bindings