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

}
相关推荐
RainbowSea几秒前
11. Spring AI + ELT
java·spring·ai编程
李慕婉学姐2 分钟前
Springboot黄河文化科普网站5q37v(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库·spring boot·后端
道之极万物灭5 分钟前
Go基础知识(一)
开发语言·后端·golang
RainbowSea5 分钟前
12. 模型RAG评测
java·spring·ai编程
Victor3569 分钟前
Redis(71)如何确保Redis分布式锁的可靠性?
后端
Victor35612 分钟前
Redis(70)分布式锁的超时机制如何实现?
后端
代码不停27 分钟前
Java前缀和算法题目练习
java·开发语言·算法
豆沙沙包?28 分钟前
2025年--Lc200- 414. 第三大的数(大根堆)--Java版
java·开发语言
时间行者_知行合一32 分钟前
我们讲讲MCP, FuncionCall和Agent
后端
metikos34 分钟前
基于LangChain实现RAG的离线部分
后端