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

}
相关推荐
曹轲恒3 小时前
Java中断
java·开发语言
xxxmine3 小时前
Java并发wait(timeout)
java
冰冰菜的扣jio3 小时前
Redis缓存问题——一致性问题、事务、持久化
java·spring·mybatis
施棠海3 小时前
监听与回调的三个demo
java·开发语言
赴前尘4 小时前
golang 查看指定版本库所依赖库的版本
开发语言·后端·golang
毕设源码-钟学长4 小时前
【开题答辩全过程】以 家政服务平台为例,包含答辩的问题和答案
java
sheji34166 小时前
【开题答辩全过程】以 家庭教育资源网为例,包含答辩的问题和答案
java
百***78756 小时前
Grok-4.1与GPT-5.2深度对比:技术差异、适用场景及Python集成指南
java·python·gpt
Mr -老鬼7 小时前
Java VS Rust
java·开发语言·rust