欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Error creating bean with name报错

程序员文章站 2022-07-14 21:13:11
...

Unsatisfied dependency expressed through field 'mapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.grg.platform.pvac.attendance.mapper.AttendanceDailyMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Error creating bean with name报错

解决方法:经检查代码中,controller、Service层以及Dao层分别都有@controller、@Service、@Dao注解以及@autowired注解,排除没有注解导致的问题,在启动类,添加 

@MapperScan("com.grg.platform.pvac.attendance.mapper") 

Error creating bean with name报错

重新启动项目,问题解决。