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

}
相关推荐
等风来_shy24 分钟前
如何写好一个 Skill
后端
one_love_zfl40 分钟前
java面试-微服务组件篇
java·微服务·面试
一只大袋鼠43 分钟前
Java进阶:CGLIB动态代理解析
java·开发语言
ailab1 小时前
研发人员如何写好 AI 提示词:从“问问题”到“驱动研发闭环”
后端
环流_1 小时前
HTTP 协议的基本格式
java·网络协议·http
爱滑雪的码农1 小时前
Java基础十三:Java中的继承、重写(Override)与重载(Overload)详解
java·开发语言
ltl1 小时前
【大模型基础设施工程】25:大模型基础设施未来
后端
ltl1 小时前
【大模型基础设施工程】二十四:成本、合规与安全
后端
【 】4231 小时前
C++&STL(Standard Template Library,标准模板库)
java·开发语言·c++
茉莉玫瑰花茶1 小时前
LangChain 核心组件 [ 2 ]
java·数据库·langchain