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

}
相关推荐
再难也得平2 分钟前
微服务拆分之SpringCloud
java·spring cloud·微服务
Java水解2 分钟前
Spring AI Alibaba 入门教程:快速集成大模型到Spring Boot应用
后端·spring
Java水解3 分钟前
Flowable工作流引擎:Spring Boot集成
后端
王中阳Go背后的男人9 分钟前
订单支付后库存不扣减,如何用RabbitMQ来优化?
后端
ypf52089 分钟前
springboot DevTools热部署
java
IT_陈寒14 分钟前
Vite 5新特性解析:10个提速技巧让你的开发效率翻倍 🚀
前端·人工智能·后端
yuuki23323335 分钟前
【数据结构】单链表的实现
c语言·数据结构·后端
刘一说37 分钟前
深入理解 Spring Boot Web 开发中的全局异常统一处理机制
前端·spring boot·后端
智_永无止境38 分钟前
Spring Boot全局异常处理指南
java·spring boot
塔能物联运维43 分钟前
物联网边缘节点数据缓存优化与一致性保障技术
java·后端·物联网·spring·缓存