简体   繁体   中英

Error of creating bean :injectionof autowired dependencies failed

I'm new to spring boot, I'm building an application using these technologies with Maven and JPA annotation, this error occured while executing my project. here is the error

Application Class

the repository interface the implementing class

There are some points that you can work on:

  • Spring boot auto configuration do the automatic scan of Spring beans so you can delete the @ComponentScan annotation (supposed that you're new so you use relatively lastest version).
  • you don't need the SalleRepoImpl (at list now as your use case is basic "save") by extending JpaRepository<Salle, Long> you have what you need (eg: findOne, findBy.., findAll) please refer to the officiel documentation .
  • The use of @Qualifier annotation is useless in you case and probably the cause of your error.

The qualifier annotation helps disambiguate bean references when Spring would otherwise not be able to do so.

For more detail, please refert to the official documentation .

Hope it was helpful :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM