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

}
相关推荐
9ilk1 分钟前
【基于one-loop-per-thread的高并发服务器】--- 自主实现HttpServer
linux·运维·服务器·c++·笔记·后端
程序员卷卷狗2 分钟前
联合索引的最左前缀原则与失效场景
java·开发语言·数据库·mysql
纪莫3 分钟前
技术面:SpringCloud(SpringCloud有哪些组件,SpringCloud与Dubbo的区别)
java·spring·java面试⑧股
间彧10 分钟前
Kubernetes无缝集成Harbor,实现CI/CD流水线
后端
会编程的吕洞宾28 分钟前
Java中的“万物皆对象”:一场编程界的哲学革命
java·后端
会编程的吕洞宾36 分钟前
Java封装:修仙界的"护体罡气"
java·后端
豆沙沙包?36 分钟前
2025年--Lc231-350. 两个数组的交集 II-Java版
java·开发语言
Real_man41 分钟前
Python SQLAlchemy 全生命周期指南:从模型、迁移到优雅会话管理
后端
好学且牛逼的马1 小时前
【SSM 框架 | day27 spring MVC】
java
是烟花哈1 小时前
后端开发CRUD实现
java·开发语言·spring boot·mybatis