Could not autowire. No beans of 'RedisConnectionFactory' type found. Resolved

Could not autowire. No beans of 'RedisConnectionFactory' type found.


Problem description:
When creating redisTemplate, the formal parameter list broke the following error

Could not autowire. No beans of ‘RedisConnectionFactory’ type found.

insert image description here
Reason:
       Here is because my main startup class has not been written yet , so the idea compiler cannot detect that this is a springboot project, so it cannot be injected successfully through formal parameters.
If this is not the reason, you can try the following method :
       first set up a simple shelf of the boot project (for example, a project with only one controller), let the project run first, verify that the front and back ends are connected, and then add the redisTemplate method to try Try, because there may be some basic dependencies or configurations that we did not notice, which caused the compiler of idea to detect an error.

Guess you like

Origin blog.csdn.net/baiqi123456/article/details/128318413