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

}
相关推荐
Lee川5 小时前
LangChain 加持:后端 AI 流式对话的优雅实现
后端
Javatutouhouduan5 小时前
2026Java面试的正确打开方式!
java·高并发·java面试·java面试题·后端开发·java编程·java八股文
JAVA面经实录9175 小时前
Java初级最终完整版学习路线图
java·spring·eclipse·maven
子兮曰6 小时前
Bun v1.3.14 深度解析:Image API、HTTP/3、全局虚拟存储与五十项变革
前端·后端·bun
Cat_Rocky6 小时前
k8s-持久化存储,粗浅学习
java·学习·kubernetes
ltl6 小时前
Self-Attention:让序列自己看自己
后端
楼兰公子6 小时前
buildroot 在编译rust时裁剪平台类型数量的方法
开发语言·后端·rust
知识领航员7 小时前
蘑兔AI音乐深度实测:功能拆解、实测表现与适用场景
java·c语言·c++·人工智能·python·算法·github
吴声子夜歌7 小时前
Go——并发编程
开发语言·后端·golang
释怀°Believe7 小时前
Spring解析
java·后端·spring