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

}
相关推荐
Whisper_Sy5 小时前
Flutter for OpenHarmony移动数据使用监管助手App实战 - 网络状态实现
android·java·开发语言·javascript·网络·flutter·php
乂爻yiyao5 小时前
1.1 JVM 内存区域划分
java·jvm
Bony-5 小时前
Go语言垃圾回收机制详解与图解
开发语言·后端·golang
没有bug.的程序员6 小时前
Spring Cloud Eureka:注册中心高可用配置与故障转移实战
java·spring·spring cloud·eureka·注册中心
CryptoRzz6 小时前
如何高效接入日本股市实时数据?StockTV API 对接实战指南
java·python·kafka·区块链·状态模式·百度小程序
码农水水6 小时前
中国邮政Java面试被问:容器镜像的多阶段构建和优化
java·linux·开发语言·数据库·mysql·面试·php
若鱼19196 小时前
SpringBoot4.0新特性-BeanRegistrar
java·spring
好好研究7 小时前
SpringBoot - yml配置文件
java·spring boot·spring
学海无涯书山有路7 小时前
Android FragmentContainerView 新手详解(Java 版)
android·java·开发语言
XiYang-DING8 小时前
【Java SE】数据类型、变量、类型转换、运算符以及程序逻辑控制
java·开发语言