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

}
相关推荐
Felix_XXXXL8 分钟前
MySQL----case的用法
java·后端
星光一影15 分钟前
基于SpringBoot与Vue的海外理财系统设计与实现
vue.js·spring boot·后端·mysql·node.js·html5
晞微18 分钟前
实战|SpringBoot+Vue3 医院智能预约挂号系统(含 AI 助手)
人工智能·spring boot·后端
silver988632 分钟前
docker容器和分布式事务
后端
咕白m6251 小时前
基于Java 实现 PPT 到 PDF 的高效转换
java
七夜zippoe1 小时前
Java并发编程基石:深入理解JMM(Java内存模型)与Happens-Before规则
java·开发语言·spring·jmm·happens-before
YDS8291 小时前
苍穹外卖 —— Spring Task和WebSocket的运用以及订单统一处理、订单的提醒和催单功能的实现
java·spring boot·后端·websocket·spring
速易达网络1 小时前
C语言常见推理题
java·c语言·算法
m0_639817151 小时前
基于springboot纺织品企业财务管理系统【带源码和文档】
java·服务器·前端
q***31831 小时前
Spring Boot(快速上手)
java·spring boot·后端