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

}
相关推荐
高山上有一只小老虎13 小时前
等差数列前n项的和
java·算法
方圆想当图灵13 小时前
Nacos 源码深度畅游:Nacos 配置同步详解(下)
分布式·后端·github
rockmelodies13 小时前
东方通安装
java
方圆想当图灵13 小时前
Nacos 源码深度畅游:Nacos 配置同步详解(上)
分布式·后端·github
小羊失眠啦.13 小时前
用 Rust 实现高性能并发下载器:从原理到实战
开发语言·后端·rust
避避风港13 小时前
Java 抽象类
java·开发语言·python
初学小白...13 小时前
JVM入门知识点
java·服务器·jvm
C++chaofan13 小时前
基于session实现短信登录
java·spring boot·redis·mybatis·拦截器·session
摇滚侠13 小时前
idea 刷新maven,提示java.lang.RuntimeException: java.lang.OutOfMemoryError
java·maven·intellij-idea
果壳~13 小时前
【Java】使用国密2,3,4.仿照https 统一请求响应加解密
java·https