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

}
相关推荐
從南走到北13 小时前
JAVA国际版打车APP打车顺风车滴滴车跑腿APP源码Android+IOS+H5
android·java·ios
Java天梯之路13 小时前
如何接收前端参数
java·后端
独自破碎E13 小时前
从括号匹配到字符串解码:递归思想的巧妙应用
android·java·开发语言
忧郁的橙子.13 小时前
二、Rabbit MQ 高级
java·开发语言
考虑考虑14 小时前
Redis8中新特性:TopK获取最高排名的数据
redis·后端
Chan1614 小时前
【 Java八股文面试 | JVM篇 内存结构、类加载、垃圾回收与性能调优 】
java·jvm·spring boot·后端·spring·idea
kevinzeng14 小时前
JdbcTemplate常用方法
后端
yunxi_0514 小时前
分布式文件服务实战稿:从本地存储到对象存储的架构升级
后端·面试
百锦再14 小时前
第15章 并发编程
android·java·开发语言·python·rust·django·go
Chan1615 小时前
【 Java八股文面试 | Redis篇 缓存问题、持久化、分布式锁 】
java·数据库·redis·后端·spring·缓存·面试