zhu失败,找不到具体对象
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1509)at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)at org.springframework.beans.factory.solveDependency(DefaultListableBeanFactory.java:1065)at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)
注入失败:
1.常见的有没加注解或包扫描,加上便是。
2.这次是一个小细节,在加载applicationContext文件时classpath后面要加上一个*号,防止jar包里的配置文件引入不到
如:
<context-param><param-name>contextConfigLocation</param-name><param-value>classpath*:applicationContext*.xml</param-value></context-param>
本文发布于:2024-02-05 04:46:28,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170724456063156.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |