BeanDefinitionStoreException

  1. 异常摘要
  2. org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML   
  3. document from class path resource [com/herman/ss/controller]; nested exception is java.io.FileNotFoundException:  
  4.  class path resource [com/herman/ss/controller] cannot be opened because it does not exist  

解决办法:没有找配置文件为controller的xml,修改一下配置文件名字即可。

 
    1. <init-param>  
    2.     <param-name>contextConfigLocation</param-name>  
    3.     <param-value>classpath:com/herman/ss/config/testAjax.xml</param-value>  
    4. </init-param>  

异常详情:

十二月 21, 2016 8:55:12 下午 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private demo.service.CityService demo.controller.DemoController.cityService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [demo.service.CityService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.inject.Inject()}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)

 

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private demo.service.CityService demo.controller.DemoController.cityService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [demo.service.CityService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.inject.Inject()}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 29 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [demo.service.CityService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.inject.Inject()}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)

posted @ 2016-12-21 21:31  21heshang  阅读(3950)  评论(0编辑  收藏  举报