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

}
相关推荐
xieliyu.3 分钟前
Java手搓数据结构:从零模拟实现无头双向非循环链表
java·数据结构·链表
薪火铺子22 分钟前
SpringMVC请求处理流程源码解析(第3篇):视图渲染与异常处理
java·后端·spring
逻辑驱动的ken44 分钟前
Java高频面试场景题19
java·开发语言·面试·职场和发展·求职招聘
leoufung1 小时前
LeetCode 42:接雨水 —— 从“矩形法”到双指针的完整思考过程
java·算法·leetcode
小碗羊肉1 小时前
【MySQL | 第十一篇】InnoDB引擎
java·数据库·mysql
Dylan的码园1 小时前
Maven基础架构与整体认识
java·junit·maven
弹不出的5h3ll2 小时前
Ghost Bits:高位截断如何让 Java WAF 形同虚设
java·开发语言
memories1982 小时前
Go 语言 Channel(管道/通道)
开发语言·后端·golang
庞轩px2 小时前
第七篇:注解与APT深度解析——从@Override到Lombok的底层原理
java·注解·编译·lombok
千寻girling2 小时前
五一劳动节快乐 [特殊字符][特殊字符][特殊字符]
java·c++·git·python·学习·github·php