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

}
相关推荐
技术小泽28 分钟前
OptaPlanner入门以及实战教学
后端·面试·性能优化
JavaGuide28 分钟前
利用元旦假期,我开源了一个大模型智能面试平台+知识库!
前端·后端
醇氧1 小时前
【Linux】 安装 Azul Zulu JDK
java·linux·运维
多多*1 小时前
2026年1月3日八股记录
java·开发语言·windows·tcp/ip·mybatis
张较瘦_2 小时前
Springboot3 | 核心注解实战教程
java·spring boot
橙子家2 小时前
Serilog 日志库简单实践(四)消息队列 Sinks(.net8)
后端
Victor3562 小时前
Hibernate(21)Hibernate的映射文件是什么?
后端
太理摆烂哥2 小时前
C++之异常
java·开发语言·jvm
pe7er2 小时前
如何阅读英文文档
java·前端·后端
pe7er2 小时前
IDEA 实用小技巧(自用)
后端