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

}
相关推荐
短剑重铸之日2 小时前
《ShardingSphere解读》07 读写分离:如何集成分库分表+数据库主从架构?
java·数据库·后端·架构·shardingsphere·分库分表
知我Deja_Vu2 小时前
【避坑指南】ConcurrentHashMap 并发计数优化实战
java·开发语言·python
wefly20173 小时前
m3u8live.cn 在线M3U8播放器,免安装高效验流排错
前端·后端·python·音视频·前端开发工具
daidaidaiyu3 小时前
Spring IOC 源码学习 事务相关的 BeanDefinition 解析过程 (XML)
java·spring
zhanggongzichu4 小时前
小白怎么理解后端分层概念
后端·全栈
鬼蛟4 小时前
Spring————事务
android·java·spring
西门吹-禅5 小时前
【sap fiori cds up error】
java·服务器·sap cap cds
stark张宇5 小时前
Golang后端面试复盘:从Swoole到IM架构,如何支撑360w用户的实时消息推送?
后端
小码哥_常5 小时前
从0到1:搭建Spring Boot 3企业级认证授权平台
后端
敲代码的嘎仔5 小时前
Java后端面试——SSM框架面试题
java·面试·职场和发展·mybatis·ssm·springboot·八股