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

}
相关推荐
JAVA面经实录9172 分钟前
图解23种设计模式完整知识体系(Java后端面试完整版)
java·架构
阳光是sunny4 分钟前
LangGraph实战教程:状态管理与`graph.invoke`入参深度解析
前端·人工智能·后端
会飞的大鱼人10 分钟前
一文搞懂 Java HashSet:把它想成游乐园里只允许一次入场的盖章名单
java·开发语言·windows
AI_小站11 分钟前
Loop Engineering又是啥?一文讲清企业Agent落地的四层工程进化论
java·人工智能·架构·prompt·大模型开发·智能体·大模型应用
神奇小汤圆16 分钟前
深入解析 Flink Kafka Connector:原理、配置与最佳实践
前端·后端
神奇小汤圆40 分钟前
在 Nacos 点了下线,为什么流量还是打到了停机的机器上?
后端
jiay243 分钟前
【.net10】顶级程序语句
java·开发语言
阳光是sunny1 小时前
LangGraph实战教程:一文搞懂图的状态(State)管理
前端·人工智能·后端
whyfail1 小时前
前端学 Spring Boot(5):从“你是谁”到“服务真的上线了”
前端·spring boot·后端
2601_953824611 小时前
【计算机毕业设计】基于Spring Boot的画师接稿平台设计与实现
java·spring boot·后端