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

}
相关推荐
爱海贼的无处不在1 小时前
一个需求竟然要开14个会:程序员的日常到底有多“会”?
后端·程序员
IT_陈寒2 小时前
Java 性能优化:5个被低估的JVM参数让你的应用吞吐量提升50%
前端·人工智能·后端
南囝coding2 小时前
《独立开发者精选工具》第 018 期
前端·后端
绝无仅有3 小时前
数据库MySQL 面试之死锁与排查经验总结
后端·面试·github
用户384958730693 小时前
Spring Boot 集成 Redis 的完整流程
后端
昨日的风3 小时前
springboot 多数据源切换
后端
绝无仅有4 小时前
mysql性能优化实战与总结
后端·面试·github
道可到4 小时前
Java 反射现代实践速查表(JDK 11+/17+)
java
用户8356290780514 小时前
从手动编辑到代码生成:Python 助你高效创建 Word 文档
后端·python
道可到4 小时前
Java 反射现代实践指南(JDK 11+ / 17+ 适用)
java