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

}
相关推荐
野生技术架构师4 分钟前
Tomcat Service的设计和实现:StandardService
java·tomcat
techdashen7 分钟前
Cloudflare 如何用 Rust 构建一个高性能解释器
开发语言·后端·rust
sing~~11 分钟前
SpringCloud的了解和使用
后端·spring·spring cloud
Gofarlic_OMS13 分钟前
UG/NX许可证管理高频技术问题解答汇编
java·大数据·运维·服务器·汇编·人工智能
逐星ing18 分钟前
IDEA 无法识别 `mvn install` 最新 SNAPSHOT 依赖的根因与完整解决方案
java·ide·intellij-idea
神奇小汤圆19 分钟前
K8s生产环境那些文档不会告诉你的坑
后端
流觞 无依25 分钟前
Spring Boot 未授权访问漏洞排查与修复指南
java·spring boot·后端
Java开发的小李27 分钟前
SpringBoot 高流量高并发 基础全面讲解
java·spring boot·后端·性能优化
Flynt31 分钟前
Uber 75000测试类JUnit迁移:OpenRewrite+Bazel实战
后端
Kqwert31 分钟前
C# PDF转图片工具类 - 基于Docnet和SkiaSharp的实现
后端