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

}
相关推荐
百***8646几秒前
Spring Boot应用关闭分析
java·spring boot·后端
tanxiaomi1 分钟前
Spring、Spring MVC 和 Spring Boot ,mybatis 相关面试题
java·开发语言·mybatis
00后程序员2 分钟前
WebApp 上架 iOS 的可行性分析,审查机制、技术载体与工程落地方案的全流程说明
后端
Java水解3 分钟前
从零开始打造高性能数据结构——手把手教你实现环形缓冲
后端
弥巷4 分钟前
【Android】常见滑动冲突场景及解决方案
android·java
浮尘笔记5 分钟前
Go并发编程核心:Mutex和RWMutex的用法
开发语言·后端·golang
疯狂的程序猴10 分钟前
混淆 iOS 类名变量名,从符号隐藏到成品 IPA 混淆的工程化方案
后端
爱吃的小肥羊15 分钟前
GPT-5.1-Codex-Max正式发布,超越Gemini 3,编程能力第一!(附使用方法)
后端·aigc·openai
间彧17 分钟前
GraalVM 深度解析:下一代 Java 技术平台
java
郡杰20 分钟前
Spring(2-IOC/DI管理第三方)
后端