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

}
相关推荐
Nebula_g5 分钟前
云禾外卖补充—项目整体后端运行逻辑-对流程的更深层次理解
java·开发语言·网络·数据库·状态模式·javase
萧瑟余晖6 分钟前
Spring Security 6.x新特性与架构演进详解
java·spring·架构
\光辉岁月/12 分钟前
1.Object类
java·面向对象·object类
黄鹂鸟科技16 分钟前
软件定制开发设计要点:从需求梳理、原型确认到敏捷交付与持续维护
后端·物联网·系统架构
Profile排查笔记20 分钟前
指纹浏览器 GitHub 项目怎么选?先看仓库交付的是工具、内核还是管理器
前端·人工智能·后端·自动化
鸽鸽程序猿23 分钟前
【项目】【在线判题系统】公共功能
java·spring boot·maven
高频因子挖掘机24 分钟前
多股票行情为什么容易对不齐?用 Pandas MultiIndex 管理标的、日期与缺失值
后端·github·api
一只笨菜鸟32 分钟前
IDEA如何让多个项目同时显示
java·ide·intellij-idea
萧瑟余晖36 分钟前
Spring Security架构总览与过滤器链详解
spring·架构
G018_star sky♬36 分钟前
java中的字符串常见方法
java·开发语言