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

}
相关推荐
疯狂的程序猴5 小时前
Transporter 在 iOS 上架流程中的角色变化 本地上传工具的定位、局限与多工具协作趋势分析
后端
better_liang5 小时前
每日Java面试场景题知识点之-线程池配置与优化
java·性能优化·面试题·线程池·并发编程
q***2515 小时前
Windows操作系统部署Tomcat详细讲解
java·windows·tomcat
N***H4865 小时前
使用Springboot实现MQTT通信
java·spring boot·后端
CoderYanger5 小时前
优选算法-队列+宽搜(BFS):72.二叉树的最大宽度
java·开发语言·算法·leetcode·职场和发展·宽度优先·1024程序员节
白气急5 小时前
别用“设计感”掩盖无知:从一次 null == 0 的事故说起
后端
赵大海5 小时前
黑马《Java架构师实战训练营 (含完整资料)》
java
疏狂难除6 小时前
随便玩玩lldb (二)
开发语言·后端·rust
不带刺仙人球6 小时前
list.stream().collect例子
java·list·dubbo
京东零售技术6 小时前
DongSQL数据库内核V1.1.0介绍
后端