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

}
相关推荐
吴声子夜歌9 分钟前
Java数据结构与算法——基本数学问题
java·开发语言·windows
Victor3569 分钟前
Hibernate(32)什么是Hibernate的Criteria查询?
后端
Victor35615 分钟前
Hibernate(31)Hibernate的原生SQL查询是什么?
后端
_UMR_1 小时前
springboot集成Jasypt实现配置文件启动时自动解密-ENC
java·spring boot·后端
程序员小假1 小时前
我们来说说 Cookie、Session、Token、JWT
java·后端
短剑重铸之日1 小时前
《SpringBoot4.0初识》第一篇:前瞻与思想
java·开发语言·后端·spring·springboot4.0
it_czz2 小时前
LangSmith vs LangFlow vs LangGraph Studio 可视化配置方案对比
后端
蓝色王者2 小时前
springboot 2.6.13 整合flowable6.8.1
java·spring boot·后端