@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 分钟前
AI编程出海第二步:验证关键词能否做站
前端·人工智能·后端
严同学正在努力21 分钟前
从备份到恢复:我用 30 分钟恢复了误删的核心业务表
android·java·数据库·ai
Csvn1 小时前
📊 SQL 入门 Day 11:CASE 表达式:SQL 里的 if-else 魔法
后端·sql
QQ_21696290961 小时前
Spring Boot 养老院管理系统:从入住、护理到费用结算的全流程实现(源码可领)
java·spring boot·后端
cxoptics1 小时前
冰洲石分束器设计与应用
java
ck-joker2 小时前
M1 Pro跑LLM实测:Ollama+LangChain4j零成本本地大模型开发,比云端API快在哪?
java·语言模型
丙氨酸長鏈2 小时前
[Bukkit插件开发]手持发射器箭矢机枪 教学文档 面向Python/C#开发者入门Java与Bukkit API
java·python·c#
Nontee2 小时前
设计模式:模板方法与策略,从“每个字都认识“到能说清它们在干嘛
java·数据库·设计模式
我是唐青枫2 小时前
Java ReentrantLock 实战详解:比 synchronized 更灵活的可重入锁
java·开发语言
自强的小白3 小时前
Docker命令
java·docker·容器