错误描述:
No qualifying bean of type 'com.ch.jpa.EmployeeJPA' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
也就是这个自动注入出了问题:
@Autowired
EmployeeJPA dao;
百度到说是springboot主类位置问题导致的包没扫描到,但是我确认过了包路径是没问题的,以下是我的包位置:
主类的包位置
jpa的包位置,是在主类的子包下的
jpa的内容。
一但我准备@Autowired这个EmployeeJPA他就报错,需要一个bean,但是我看到说继承了JpaRepository之后就能直接自动注入的。
求解。