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

}
相关推荐
灰色人生qwer1 分钟前
VS Code 配置Java环境
java·开发语言
tgethe2 分钟前
Java 链表(LinkedList)
java·开发语言·链表
梁萌4 分钟前
idea使用AI插件(CodeGeeX)
java·ide·ai·intellij-idea·插件·codegeex
文心快码BaiduComate5 分钟前
用Spec给AI Agent立规矩,AI编码告别手忙脚乱
前端·后端·前端框架
东北小狐狸-Hellxz6 分钟前
后端生成的URL中含base64参数值,经tomcat重定向后偶发前端无法解密报错
java·前端·tomcat
悟能不能悟12 分钟前
java list怎么进行group
java·python·list
程序员在囧途14 分钟前
Sora2 25 秒视频 API 国内直连!10 积分/次,稳定秒退任务,支持 avatar & Remix(附 PHP 接入教程)
后端·开源·php
专注于大数据技术栈16 分钟前
java学习--Math 类常用方法
java·学习
Lisonseekpan23 分钟前
UUID vs 自增ID做主键,哪个好?
java·数据库·后端·mysql
利刃大大27 分钟前
【SpringBoot】配置文件 && 日志输出 && lombok
java·spring boot·后端