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

}
相关推荐
Frostnova丶6 小时前
LeetCode 190.颠倒二进制位
java·算法·leetcode
闻哥7 小时前
Redis事务详解
java·数据库·spring boot·redis·缓存·面试
hrhcode7 小时前
【Netty】五.ByteBuf内存管理深度剖析
java·后端·spring·springboot·netty
道亦无名7 小时前
aiPbMgrSendAck
java·网络·数据库
发现你走远了7 小时前
Windows 下手动安装java JDK 21 并配置环境变量(详细记录)
java·开发语言·windows
心 -7 小时前
java八股文DI
java
NEXT067 小时前
后端跑路了怎么办?前端工程师用 Mock.js 自救实录
前端·后端·程序员
泯泷8 小时前
提示工程的悖论:为什么与 AI 对话比你想象的更难
人工智能·后端·openai
黎雁·泠崖8 小时前
Java常用类核心详解(一):Math 类超细讲解
java·开发语言
大尚来也8 小时前
跨平台全局键盘监听实战:基于 JNativeHook 在 Java 中捕获 Linux 键盘事件
java·linux