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

}
相关推荐
零度@18 分钟前
30条Java性能优化清单
java·开发语言
期待のcode24 分钟前
Java的包装类
java·开发语言
老马952725 分钟前
MyBatis-Plus 动态表名的正确打开方式
后端·mybatis
李少兄30 分钟前
从一篇IDEA笔记开始,我走出了自己的技术创作路
java·笔记·intellij-idea
Java水解33 分钟前
springboot: Spring Boot 启动流程详解
spring boot·后端
马卡巴卡40 分钟前
为什么Spring不建议使用@Autowired?@Resource才是王道
后端
martin101741 分钟前
Oracle 11g 数据库卡顿排查与实战优化:一次真实的慢 SQL 定位全过程
数据库·后端
Linux Huang43 分钟前
spring注册组件/服务无效,问题排查
大数据·服务器·数据库·spring
鹿角片ljp44 分钟前
力扣26.有序数组去重:HashSet vs 双指针法
java·算法
SweetCode1 小时前
汉诺塔问题
android·java·数据库