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

}
相关推荐
KobeSacre1 小时前
ForkJoinPool 源码
java
橘色的喵1 小时前
ARM-Linux 嵌入式库:内存池与信号量的无锁化改造
后端
SamDeepThinking1 小时前
写代码,到底应该参考优秀作品,还是坚持自己的想法?
后端
wear工程师1 小时前
Kafka 消费者心跳正常,为什么还会被踢出组?拆清 max.poll.interval.ms
java·kafka
cfm_29141 小时前
基于OAuth2.0实现微服务SSO单点登录
后端·spring·微服务·架构
橘色的喵1 小时前
MergeCell 合并机制:双平台事件流去重
后端
SemiTris1 小时前
为什么 C/C++ 不走 Java 式的虚拟机跨平台路线?
java·程序员
予怀9601 小时前
ClickHouse踩坑:一个sum()引发的"数字不一致"悬案
后端
橘色的喵2 小时前
ReclaimBatcher 批量回收:RT-Thread 单核与 Linux SMP 通用
后端