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

}
相关推荐
Wang153019 分钟前
jdk内存配置优化
java·计算机网络
0和1的舞者42 分钟前
Spring AOP详解(一)
java·开发语言·前端·spring·aop·面向切面
Wang15301 小时前
Java多线程死锁排查
java·计算机网络
嘟嘟MD1 小时前
程序员副业 | 2025年12月复盘
后端·创业
小小星球之旅1 小时前
CompletableFuture学习
java·开发语言·学习
利刃大大2 小时前
【SpringBoot】Spring事务 && @Transactional详解 && Spring事务失效问题
spring boot·spring·事务
jiayong232 小时前
知识库概念与核心价值01
java·人工智能·spring·知识库
皮皮林5512 小时前
告别 OOM:EasyExcel 百万数据导出最佳实践(附开箱即用增强工具类)
java
..过云雨3 小时前
17-2.【Linux系统编程】线程同步详解 - 条件变量的理解及应用
linux·c++·人工智能·后端
Da Da 泓3 小时前
多线程(七)【线程池】
java·开发语言·线程池·多线程