@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 分钟前
LLM _ Agent _ Skill _ 专家 的关系与选型笔记
java·开发语言·人工智能·笔记·大模型·智能体·skill
文丑颜不良啊9 分钟前
LeetCode1541~1560题目解析
java·leetcode
starzy199010 分钟前
Scala String操作:从插值器到正则的完整指南
开发语言·后端·scala
她说彩礼65万13 分钟前
C# TaskCompletionSource
java·开发语言·c#
当战神遇到编程15 分钟前
Java 基础入门(七):递归详解——执行原理、方法调用栈与经典练习
java
starzy199024 分钟前
Scala Array操作:从定长数组到ArrayBuffer的完整指南
开发语言·后端·scala
IT_陈寒25 分钟前
Python项目实战经验分享:为什么你的多进程日志会丢失?
前端·人工智能·后端
若亦_26 分钟前
排序>>交换排序
java·数据结构·算法
Wang's Blog31 分钟前
MongoDB 地理位置上报实战:从接口设计到覆盖写入的完整实现
java·交友
鬼手点金1 小时前
Skills:领域能力的可组合单元
java·人工智能·笔记·自动化·1024程序员节