Error creating bean with name ‘redisTemplate’ defined in class path resource [xx/RedisConfig.class]
1. Problem description
When redis is used in the project, the following errors are reported:
2. Problem analysis
From the error reporting factory method ‘redisconnectionfactory’ thread exception; Needed exception is java.lang.noclassdeffounderror: org/Apache/commons/pool2/impl/genericobjectpoolconfig get key information. NoClassDefFoundError: it is caused by that the JVM cannot load the class or cannot find the class at compile time
reasons for NoClassDefFoundError:
1) one reason is that static variables cannot be loaded
2) if jars are not added to classpath and Maven projects in the project, they need to be checked according to the project conditions
3. Problem handling
The spring boot starter data redis package referenced in the project. By default, spring boot starter data redis uses lettuce as the redis client, and the underlying layer of lettuce is implemented by netty. Lettuce is a scalable thread safe redis client that supports synchronization, asynchronous and responsive modes. Multiple threads can share a connection instance without worrying about multithreading concurrency. The use of lettuce requires the configuration of thread pool. You also need to reference the following packages:
Read More:
- Error creating bean with name ‘lettuceClientResources‘ defined in class path resource
- Error creating bean with name ‘datasource’ defined in class path resource
- Error creating bean with name ‘requestMappingHandlerAdapter‘ defined in class path resource
- Error creating bean with name ‘sqlsessionfactory’ defined in class path resource
- Error creating bean with name ‘sqlsessionfactory’ defined in class path resource…..
- Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource
- Error creating bean with name ‘feignTargeter‘ defined in class path resource [org/springframework/cl
- Error creating bean with name ‘entitymanagerfactory’ defined in class path resource
- Error creating bean with name ‘sqlsessionfactory’ defined in ServletContext resource)
- Solution to the problem of spring boot running test class error creating bean with name ‘serverendpoint exporter’ defined
- Error creating bean with name ‘application‘: Instantiation of bean failed;
- An error happened during template parsing (template: “class path resource
- Error creating bean with name ‘redissonclient’:
- Idea SpringBoot:Error creating bean with name ‘XXXXController‘
- Error creating bean with name usercontroller appears when springboot starts
- Error creating bean with name ‘enablererediskeyspacenotificationsinitializer’
- Error creating bean with name ‘sqlsessionfactory’ appears in SSM framework integration‘
- elasticsearch NoClassDefFoundError error creating RestHighLevelClient bean
- An error is reported when springboot starts: error creating bean with name ‘XXXX’
- Error creating bean with name ‘xxcontroller’