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

}
相关推荐
黑牛儿12 分钟前
面试高频问题:从浏览器请求到PHP响应:完整流程拆解
android·后端·面试·php
BOOM朝朝朝13 分钟前
envoy-gateway 解析
后端
搬搬砖得了16 分钟前
Spring Boot Bean 生命周期与作用域:从单例到原型,完整剖析
后端·架构
fliter20 分钟前
Cargo 要自动帮你清理缓存了
后端
淡然一笑35321 分钟前
Linux服务器安装失败全面指南:常见问题深度解析与高效解决策略
后端
小谢小哥23 分钟前
41-分布式事务详解
后端
IT_陈寒24 分钟前
Java集合的这个坑,我调试了整整3小时才爬出来
前端·人工智能·后端
0xDevNull28 分钟前
Spring Boot 3.x 整合 Nacos 全栈实战教程
java·spring boot·nacos
落木萧萧82529 分钟前
MyBatisGX 示例工程:CRUD + 关联查询完整演示
java·后端
fliter33 分钟前
一个徽章坏了,顺带扯出了 2.3 万个 feature
后端·架构