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

}
相关推荐
用户7138742290019 小时前
OAuth 2.0 中的state参数:从规范到实践的深度解析
后端
倚栏听风雨19 小时前
StateGraph 详细分析
后端
用户7138742290019 小时前
Cookie 深度技术指南:从原理到安全实践
后端
倚栏听风雨19 小时前
AsyncCommandAction 详细分析
后端
倚栏听风雨19 小时前
Edge 详细分析
后端
倚栏听风雨19 小时前
CompiledGraph 详细分析
后端
努力发光的程序员19 小时前
互联网大厂Java面试问答及技术分析(涵盖Spring Boot及微服务)
java·微服务·面试·springboot·技术问答
装不满的克莱因瓶19 小时前
【项目亮点四】支付订单超时处理与状态补偿机制设计
java·开发语言·后端·rabbitmq·消息中间件
@Murphy19 小时前
java 面试
java·开发语言·面试
楼田莉子19 小时前
C#学习:分支与循环
服务器·后端·学习·c#