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

}
相关推荐
网安INF3 分钟前
ElGamal加密算法:离散对数难题的安全基石
java·网络安全·密码学
AWS官方合作商1 小时前
在CSDN发布AWS Proton解决方案:实现云原生应用的标准化部署
java·云原生·aws
gadiaola2 小时前
【JVM】Java虚拟机(二)——垃圾回收
java·jvm
coderSong25685 小时前
Java高级 |【实验八】springboot 使用Websocket
java·spring boot·后端·websocket
Mr_Air_Boy5 小时前
SpringBoot使用dynamic配置多数据源时使用@Transactional事务在非primary的数据源上遇到的问题
java·spring boot·后端
豆沙沙包?6 小时前
2025年- H77-Lc185--45.跳跃游戏II(贪心)--Java版
java·开发语言·游戏
年老体衰按不动键盘6 小时前
快速部署和启动Vue3项目
java·javascript·vue
咖啡啡不加糖6 小时前
Redis大key产生、排查与优化实践
java·数据库·redis·后端·缓存
liuyang-neu7 小时前
java内存模型JMM
java·开发语言
大鸡腿同学7 小时前
纳瓦尔宝典
后端