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

}
相关推荐
庞轩px6 小时前
第七篇:Spring扩展点——如何优雅地介入Bean的创建流程
java·后端·spring·bean·aware·扩展点
ltl6 小时前
Q/K/V 三件套:把 Bahdanau 抽象成一个公式
后端
tongluowan0077 小时前
一个请求在Spring MVC 中是怎么流转的
java·spring·mvc
千叶风行8 小时前
Text-to-SQL 技术设计与注意事项
前端·人工智能·后端
夜郎king8 小时前
Spring AI 对接大模型开发易错点总结与实战解决办法
java·人工智能·spring
oradh8 小时前
Oracle数据库中的Java概述
java·数据库·oracle·sql基础·oracle数据库java概述
组合缺一8 小时前
Java AI 框架三国杀:Solon AI vs Spring AI vs LangChain4j 深度对比
java·人工智能·spring·ai·langchain·llm·solon
阿kun要赚马内8 小时前
后端数据操作组合:Pydantic与ORM
后端·python·orm·sqlalchemy
c++之路8 小时前
适配器模式(Adapter Pattern)
java·算法·适配器模式
吴声子夜歌9 小时前
Java——接口的细节
java·开发语言·算法