Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDepe
Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name xxx
spring bean创建失败
我的是ssm项目,项目已启动就报错,mapper接口和mapper的配置文件放在了两个文件夹下,导致创建失败
sending contextinitialized event to listener instance of classorg.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'itemServiceImpl': Injection of autowireddependencies failed; nested exception isorg.springframework.beans.factory.BeanCreationException: Could not autowirefield: org.apache.solr.client.solrj.SolrServercom.taotao.search.service.impl.ItemServiceImpl.solrServer; nested exception isorg.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifyingbean of type [org.apache.solr.client.solrj.SolrServer] found for dependency:expected at least 1 bean which qualifies as autowire candidate for thisdependency. Dependency annotations:{@org.springframework.beans.factory.annotation.Autowired(required=true)}
itemServieImpl代码:
再次看报错,向前看是spring的context初始化出错,那么什么时候加载spring容器的呢?
自然,这得看web.xml
重点是这里加载spring容器只是将spring/下面的所有applicationContext-*.xml文件加载
但是我的solr是这样的