Error creating bean with name ‘tagServiceImpl‘: Unsatisfied dependency expressed through field
Posted 劭兮劭兮
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error creating bean with name ‘tagServiceImpl‘: Unsatisfied dependency expressed through field相关的知识,希望对你有一定的参考价值。
最近,一直在运用 springboot + thymeleaf 写项目(跟着李仁密老师的小而美博客项目)。今天,遇到了一个很粗心的bug:
错误
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2021-06-06 15:24:45.124 ERROR 11084 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tagServiceImpl': Unsatisfied dependency expressed through field 'tagRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tagRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property fingByName found for type Tag!
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.11.RELEASE.jar:4.3.11.RELEASE]
脑子有点糊涂,看了半天也没有看出来哪里错了,去网上找寻各种解决方法:
@Service
@Autowired
启动类没有放对位置:
可是,我注解加了,也放对位置了,就是运行不成功;
第二天脑子清醒的时候发现,emmmmm,我真是个小智障,把方法的名字写错了:
本人小白一个,这个bug很低级(完全是因为自己的粗心大意造成的),只是简单记录一下,欢迎小伙伴们可以一起探讨!
以上是关于Error creating bean with name ‘tagServiceImpl‘: Unsatisfied dependency expressed through field的主要内容,如果未能解决你的问题,请参考以下文章
Error creating bean with name ‘requestMappingHandlerMapping‘
react(85)--error:Error creating bean with name ‘onlineStudyController‘:
Error creating bean with name 'eurekaAutoServiceRegistration'