今天在写项目的时候报了如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘blogController’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userServiceImpl’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘redisTemplate’ is expected to be of type ‘org.springframework.data.redis.core.StringRedisTemplate’ but was actually of type ‘org.springframework.data.redis.core.RedisTemplate’
at
…
最后经过我的一番排查发现:
这里的形参名字我写成的是redisTemplate导致的,具体为啥咱也不知道可能与底层实现有关,将redisTemplate参数全部替换完成,可以完成正常的启动。如果你也遇见同样的问题,可以尝试本方法进行修复。
Springboot启动报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with nam
最新推荐文章于 2024-05-30 16:18:05 发布