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

}
相关推荐
贾斯汀玛尔斯3 小时前
每天学一个算法--LSM-Tree(Log-Structured Merge Tree)
java·算法·lsm-tree
bitt TRES3 小时前
springboot与springcloud对应版本
java·spring boot·spring cloud
Y001112363 小时前
JavaWeb-end
java·servlet·web
万少4 小时前
Vibe Coding不停歇,移动端 TRAE SOLO 让你用手机也能编程啦
前端·javascript·后端
bzmK1DTbd4 小时前
Git版本控制:Java项目中的分支管理与合并策略
java·开发语言·git
Rust研习社4 小时前
为什么 Rust 没有空指针?
开发语言·后端·rust
皮皮林5514 小时前
全网最全的 Jenkins + Maven + Git 自动化部署指南!
后端
舒一笑4 小时前
用几十行代码搞定 Chat 接口透明转发:跨环境轻量级网关实战
后端·程序员·架构
铁皮饭盒6 小时前
成为AI全栈 - 第3课:路由 RESTful Elysia 状态码 设计规范
前端·后端·全栈
我叫黑大帅6 小时前
如何通过 Python 实现招聘平台自动投递
后端·python·面试