@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 分钟前
springmvc文件上传
java·开发语言
龙华2 分钟前
Maven多仓库/依赖配置
java·maven
00后程序员3 分钟前
Objective-C 测试(OC 测试)指南 从单元测试到性能调优的多工具协同方法
后端
天道佩恩3 分钟前
MapStruct转换实体
java·后端
Boop_wu5 分钟前
[Java 面试] 多线程1
java·开发语言
专注于大数据技术栈6 分钟前
java学习--main方法
java·开发语言·学习
Asthenia041210 分钟前
技术复盘:Solon-MCP 日志统一配置背后的技术架构分析
后端
2501_9418024816 分钟前
C++高性能并发编程实战:从多线程管理到内存优化与任务调度全流程解析
java·开发语言·c++
0***R51526 分钟前
SpringBoot集成Elasticsearch实战
java·spring boot·elasticsearch