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

}
相关推荐
那个松鼠很眼熟w7 分钟前
4.Spring-Ai入门案例
java·人工智能·spring
计算机毕设定制辅导-无忧学长8 分钟前
《基于SpringBoot青年公寓出租管理系统的设计与实现》
java·vue.js·spring boot·青年公寓出租管理系统
泡海椒1 小时前
JQuick-Curl 二次开发:自定义解析器、扩展点开发指南,如何把框架能力真正变成团队资产
java·开发语言·okhttp·maven
青山木2 小时前
Hot 100 --- 数组中的第K个最大元素
java·数据结构·算法·排序算法
玛卡巴卡ldf2 小时前
【AICoding】笔试提示词设计思路
java·算法·ai编程
IT_陈寒2 小时前
Python的多线程居然是个假把式?搞清GIL让我少熬三天夜
前端·人工智能·后端
珍珠先生2 小时前
第10章 JDK 17 新特性:语法糖与新能力
java
明月_清风2 小时前
位图与布隆过滤器:海量数据下的"存在性判断"艺术
前端·后端·算法
明月_清风2 小时前
Hash 表从入门到精通:Go 实战与工程细节
前端·后端·算法
考虑考虑2 小时前
ElasticSearch索引命令
运维·后端·elasticsearch