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

}
相关推荐
Reart7 分钟前
Leetcode 674.最长连续递增序列 (719)
后端·算法
sun032210 分钟前
【笔记】Spring MVC 相关介绍
java·spring·mvc
芒鸽13 分钟前
HarmonyOS ArkUI Search 搜索框:联想词、历史记录与热门标签
后端
兰令水22 分钟前
hot100【acm版】【2026.7.18打卡-java版本】
java·开发语言·算法
Reart29 分钟前
Leetcode 714.买卖股票的最佳时机含手续费(719)
后端·算法
芒鸽43 分钟前
HarmonyOS ArkUI RichEditor 富文本编辑器:内联样式、Span 管理与格式工具栏
后端
花开彼岸天~44 分钟前
Router 路由管理:pushUrl、replaceUrl、back 与参数传递
后端
CoderYanger1 小时前
A.每日一题:3020. 子集中元素的最大数量
java·程序人生·算法·leetcode·面试·职场和发展·学习方法
wear工程师1 小时前
CompletableFuture 的 allOf 到底怎么收结果?面试别只说并行
java·后端
b130538100491 小时前
DiaryDetail2Page 卡片式详情:琥珀渐变 + 引号装饰
后端