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

}
相关推荐
A_aspectJ4 分钟前
【Java基础开发】基于 Java Swing 开发的简易计算器 - 支持键盘
java·开发语言
光影少年6 分钟前
vite+rust生态链工具链
开发语言·前端·后端·rust·前端框架
2501_913061348 分钟前
网络原理知识(7)
java·网络·面试
南境十里·墨染春水12 分钟前
linux学习进程 线程同步——读写锁
java·jvm·学习
ZWZhangYu12 分钟前
MCP 实战:从协议原理到 Java 自定义工具服务落地
java·开发语言·人工智能
IT_陈寒13 分钟前
为什么我的JavaScript变量老是不听使唤?
前端·人工智能·后端
Flittly13 分钟前
【SpringSecurity新手村系列】(5)RBAC角色权限与账户状态校验
java·spring boot·笔记·安全·spring·ai
笨蛋不要掉眼泪13 分钟前
面试篇-java基础下
java·后端·面试·职场和发展
wechatbot88814 分钟前
企业微信 iPad 协议客服机器人自动化管理平台开发指南
java·运维·微信·自动化·企业微信·ipad
weisian15118 分钟前
Java并发编程--46-热点Key与大Value:Redis集群中的“定时炸弹”
java·redis·热key·大key