@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 {

}
相关推荐
charlie1145141918 分钟前
使用 Poetry + VS Code 创建你的第一个 Flask 工程
开发语言·笔记·后端·python·学习·flask·教程
aiopencode8 分钟前
iOS 上架 App Store 全流程技术解读 应用构建、签名体系与发布通道的标准化方案
后端
Rexi13 分钟前
go如何写单元测试2
后端
Rexi13 分钟前
go如何写单元测试1
后端
chxii14 分钟前
在 Spring Boot 中,MyBatis 的“自动提交”行为解析
java·数据库·mybatis
徐子童18 分钟前
数据结构----排序算法
java·数据结构·算法·排序算法·面试题
Harry技术43 分钟前
Spring Boot 4.0 发布总结:新特性、依赖变更与升级指南
spring boot·后端
xiaohua10091 小时前
ZGC实践
java·jvm
武子康1 小时前
大数据-159 Apache Kylin Cube 实战:Hive 装载与预计算加速(含 Cuboid/实时 OLAP,Kylin 4.x)
大数据·后端·apache kylin
蒂法就是我1 小时前
策略模式在spring哪里用到了?
java·spring·策略模式