1. No redis package imported, then import the following jar package to solve
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
2. Do the project separation, so pay attention to the @component scanning scope of the Application startup class, default scanning of the Application startup class package and the beans under the subpackage.
is redis – common such as A project, A project of the package name is com.zhangsan.com mon. Redis. B project imports the JAR package of A project, the package name of B project is com. Zhangsan.service.B, then the Application start-up class of B project should be placed under com. Zhangsan, so as to load the beans of A project into A project.
Read More:
- The @ Autowired annotation in springboot is invalid in ordinary classes. How to solve and use the null pointer exception java.lang.nullpointerexception
- An error is reported in the spring cloud setup. Autowired appears and Eureka cannot be registered
- The solution of using Autowired annotation to report errors in IntelliJ idea
- Solution of idea using @ Autowired annotation to report errors
- Update project manually_ Solution of too large jar package in springboot
- Solution to the failure of springboot integrated PageHelper
- [Solved] SpringBoot Integrating Oracle reports errors: ORA-12504, TNS:listener was not given the SID in CONNECT_DATA
- Solution of error report in springboot Maven package websocket
- Error creating bean with name ‘helloController‘: Injection of autowired dependencies failed;
- Solutions to the problem of “Autowired cannot be resolved to a type” in eclipse Maven project
- @Autowired injection * * required a single bean, but 2 were found**
- [Solved] ERROR Error: No module factory availabl at Object.PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST ‘Error
- Springboot + mybatis + logback does not print SQL problems on the console
- Springboot error, unable to read configuration file: could not resolve placeholder ‘xxx’ in value “${XXX}
- Springboot startup error [extshutdown hook]
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- Solve the problem that springboot does not scan @ repository
- How to realize automatic assembly in springboot
- [Solved] org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zyh.springboot.
- shiro Error org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type