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

}
相关推荐
ShadowYD30 分钟前
Agent Loop:一个让 AI 编程 Agent 从"会写代码"进化到"闭环交付"的开源 Skill(适配国内外主流 Code Agent)
后端
考虑考虑2 小时前
nohup启动java程序
后端·自动化运维
鹿角片ljp3 小时前
LeetCode 64:最小路径和复盘|二维 DP 与 ACM 模式完整写法
java·数据结构·算法
aramae3 小时前
模拟实现strcmp()(C语言)
c语言·开发语言·后端
泡海椒4 小时前
PDF 表格样式优化:jquick-pdf 边框、圆角、背景色
java·开发语言·pdf
根目录下的猫5 小时前
RK3588适配的轻量级AI模型推荐
人工智能·后端·python·目标检测
景熙55235 小时前
15.Java 8 Stream 流入门到实战
java·开发语言·数据结构
wno7046 小时前
Spring Security权限控制
java·python·spring
星栈6 小时前
用 Rust 写 Agent 服务 -- adk-rust 上手记
后端·agent