哈密瓜Q 2021-08-21 13:10 采纳率: 62.5%
浏览 62
已结题

关于SSM框架整合时业务层的实现类添加@Service后仍不能创建对应bean的问题

如下是错误提示:

org.springframework.beans.factory.BeanCreationException: **Error creating bean with name 'studentController'**: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.StudentService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class com.service.impl.StudentServiceImpl, mappedName=)}

提示说我没有创建对应的bean导致注入失败,可是在StudentServiceImpl上我有添加注解@Service

img
如下是在控制器中调用StudentServiceImpl的方法时的错误提示:

img

网上找了很多方法也没弄好,希望有大佬给解答一下,先谢为敬!

  • 写回答

1条回答 默认 最新

  • 编号灬9527 2021-08-21 13:29
    关注

    留个鹅号,远程看看

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 8月29日
  • 已采纳回答 8月21日
  • 创建了问题 8月21日