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

}
相关推荐
oil欧哟28 分钟前
为什么我们不建议盲目构建多 Agent 系统
前端·后端
码途行者1 小时前
每天10分钟学Go:第24课 通道-协程之间的传送带
开发语言·后端·golang
SimonKing1 小时前
别OCR了,都在用了OXR了,看那看那这款开源的OXR产品
java·后端·程序员
Rain的Java大神之路1 小时前
DTO、VO、PO 到底要不要拆?这场 Java 分层之争,今天一次讲透
java·后端·面试
Moment1 小时前
怎么给客户讲清本体、知识图谱和大模型的关系
前端·后端·面试
CoderYanger1 小时前
Java EE 进阶:14.案例综合练习-博客系统(第三弹) :用户登录+强制登录
java·服务器·开发语言·数据库·spring boot·java-ee·mybatis
CoderYanger7 小时前
Java EE 进阶:13. Spring事务和事务传播机制(第二弹)
java·开发语言·数据库·spring boot·后端·spring·java-ee
会编程的吕洞宾10 小时前
Spring AI 2.0 MCP 客户端实战:让 Java AI 应用接入现成工具
java·人工智能·经验分享·后端·spring
行者-全栈开发12 小时前
SpringBoot 熔断降级实战:Resilience4j 与 Sentinel 双方案深度对比与落地
spring boot·后端·sentinel