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

}
相关推荐
行百里er1 天前
2026:一名码农的“不靠谱”年度规划
后端·程序员·架构
全靠bug跑1 天前
Spring Cache 实战:核心注解详解与缓存过期时间配置
java·redis·springcache
聆风吟º1 天前
【数据结构手札】空间复杂度详解:概念 | 习题
java·数据结构·算法
计算机程序设计小李同学1 天前
基于SpringBoot的个性化穿搭推荐及交流平台
java·spring boot·后端
是一个Bug1 天前
50道核心JVM面试题
java·开发语言·面试
用户47949283569151 天前
同事一个比喻,让我搞懂了Docker和k8s的核心概念
前端·后端
朱朱没烦恼yeye1 天前
java基础学习
java·python·学习
她和夏天一样热1 天前
【观后感】Java线程池实现原理及其在美团业务中的实践
java·开发语言·jvm
郑州光合科技余经理1 天前
技术架构:上门服务APP海外版源码部署
java·大数据·开发语言·前端·架构·uni-app·php
篱笆院的狗1 天前
Java 中的 DelayQueue 和 ScheduledThreadPool 有什么区别?
java·开发语言