@Service Spring required a bean could not be found.

Description:

Field inservice in controller

required a bean of type Inservice that could not be found.

The injection point has the following annotations:

  • @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type Inservice in your configuration.

Service的實現類上沒有標準@Service,導致Spring不能加載Bean。

复制代码
public interface InService {

}


public class InvoiceImpl implements InService {

}


@Service
@Transactional
public class InvoiceImpl implements InService {

}
相关推荐
芜名氏13 分钟前
API 文档生成工具——SpringDoc
java·spring boot·ci/cd·设计规范
回家路上绕了弯15 分钟前
AI中判断的残值
后端
Java旅途25 分钟前
高校实习管理系统|把岗位、指导与考核连成一条协同流程
后端
逃逸线LOF40 分钟前
SpringCloud Stream
后端·spring·spring cloud
IT_陈寒1 小时前
Vue开发者必知:5个让你效率翻倍的隐藏技巧
前端·人工智能·后端
这个昵称不容易1 小时前
SpringBoot 医疗病历交互系统毕设:192 个 Java 文件、256 个接口、22 张表,附真实运行截图
java·springboot·毕设
脚本自动化开发9 小时前
玩影之刃零,两张四千元级显卡怎么挑
后端
Pniubi11 小时前
怎么排查慢SQL,怎么解决?
java·数据库·sql
薛之谦_12 小时前
Java 全栈知识体系:从 IDEA 高效开发到 JVM、并发与 Stream 实战
java·jvm·intellij-idea