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

}
相关推荐
勇哥java实战分享8 小时前
程序员的明天:AI 时代下的行业观察与个人思考
后端
掘金码甲哥10 小时前
超性感的轻量级openclaw平替,我来给你打call
后端
用户83562907805113 小时前
无需 Office:Python 批量转换 PPT 为图片
后端·python
啊哈灵机一动13 小时前
使用golang搭建一个nes 模拟器
后端
日月云棠14 小时前
各版本JDK对比:JDK 25 特性详解
java
间彧14 小时前
SpringBoot + ShardingSphere 读写分离实战指南
后端
砍材农夫14 小时前
订单超时
后端
树獭叔叔14 小时前
06-大模型如何"学习":从梯度下降到AdamW优化器
后端·aigc·openai
用户83071968408215 小时前
Spring Boot 项目中日期处理的最佳实践
java·spring boot
得鹿15 小时前
MySQL基础架构与存储引擎、索引、事务、锁、日志
后端