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

}
相关推荐
Wang's Blog1 分钟前
Java 项目实战: 交友项目 - 查询单条动态:动态详情页的接口与实现
java·开发语言·交友
yuniko-n2 分钟前
【JUC】CAS
java·开发语言
captain3764 分钟前
Spring Web MVC(2)
java·前端·spring boot·后端·spring·mvc
紧跟先前的步伐5 分钟前
Go AI Agent 实战 17|模型适配层设计:让模型可替换
开发语言·人工智能·后端·ai·golang
代码山河16 分钟前
调试技巧:IDEA Debug模式入门与使用
java·学习·架构·教程·面向对象·项目
IT_陈寒26 分钟前
一文搞懂Java的核心概念
前端·人工智能·后端
文丑颜不良啊28 分钟前
LeetCode851~875题目解析
java·leetcode
技术老孙29 分钟前
给 Agent 装上对话框 —— AgentScope-Java 接入 Spring Boot 与 SSE 流式实战
java·开发语言·spring boot
铁皮饭盒30 分钟前
workbuddy和codebuddy免费送1000积分, 10秒钟搞定
前端·后端
计算机就业还在扩大1 小时前
第2期-cmp.Ordered+类型推断+刻意未支持的特性
后端·面试·golang