没有org.springframework.beans.factory.annotation.Required
时间: 2023-09-18 15:07:02 浏览: 94
spring 的Annotation方式
回答: 报错信息中提到了缺少org.springframework.beans.factory.annotation.Required注解。根据提供的引用内容,可以尝试以下解决方法。首先,可以将@Autowired注解改为@Resource注解,看看是否能解决问题。其次,检查一下controller使用的service是否已经注入到了spring容器中,可以在启动类上添加包扫描注解,确保该bean所在的包能够被扫描到。希望这些解决方法能够帮助到您。\[2\]\[3\]
#### 引用[.reference_title]
- *1* [已解决org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factor](https://blog.csdn.net/weixin_50843918/article/details/129678978)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [遇到@org.springframework.beans.factory.annotation.Autowired(required=true)问题](https://blog.csdn.net/weixin_43431218/article/details/128148720)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文