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

}
相关推荐
2301_792674862 分钟前
java学习day27(算法)
java·学习·算法
好家伙VCC8 分钟前
**基于Colab的高效Python深度学习开发流程:从环境配置到模型部署全流程实战**在当前人工智
java·开发语言·python·深度学习
身如柳絮随风扬13 分钟前
Tomcat 体系结构
java·tomcat
jaysee-sjc19 分钟前
十七、Java 高级技术入门全解:JUnit、反射、注解、动态代理
java·开发语言·算法·junit·intellij-idea
卓怡学长21 分钟前
w1基于springboot高校学生评教系统
java·spring boot·tomcat·maven·intellij-idea
ruan11451421 分钟前
关于HashMap--个人学习记录
java·jvm·servlet
BD_Marathon22 分钟前
Spring5 框架概述
spring
lvyuanj28 分钟前
Java AI开发实战:Spring AI完全指南
java·人工智能·spring
lifallen34 分钟前
如何保证 Kafka 的消息顺序性?
java·大数据·分布式·kafka
Geoking.35 分钟前
后端Long型数据传到前端js后精度丢失的问题(前后端传输踩坑指南)
java·前端·javascript·后端