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

}
相关推荐
无敌最俊朗@8 分钟前
Qt事件循环队列剖析!!!
java
v***56520 分钟前
Spring Cloud Gateway 整合Spring Security
java·后端·spring
python零基础入门小白38 分钟前
【万字长文】大模型应用开发:意图路由与查询重写设计模式(从入门到精通)
java·开发语言·设计模式·语言模型·架构·大模型应用开发·大模型学习
码事漫谈39 分钟前
C++中不同类型的默认转换详解
后端
码事漫谈39 分钟前
C++类型转换的隐蔽陷阱:当size_t遇见负数
后端
高山上有一只小老虎1 小时前
构造A+B
java·算法
学困昇1 小时前
C++中的异常
android·java·c++
MC丶科1 小时前
Java设计模式漫画英雄宇宙-工厂模式 —Factory博士的“超级英雄制造机”!
java·设计模式·漫画
码一行1 小时前
Go.1.25.4 和 Go.1.24.10 发布了!!
后端·go