beans.factory.BeanCreationException

6206阅读 0评论2011-07-26 qyf404
分类:Java

org.springframework.beans.factory.BeanCreationException:

  Error creating bean with name 'exampaperController': 

    Injection of autowired dependencies failed; 

 

    nested exception is org.springframework.beans.factory.BeanCreationException: 

      Could not autowire field: 

        private com.es.business.sys_exampaper.service.IExampaperService 

        com.es.business.sys_exampaper.controller.ExampaperController.exampaperService;

 

nested exception is org.springframework.beans.factory.BeanCreationException: 

 Error creating bean with name 'exampaperService' defined in URL 

 [jndi:/localhost/esa/WEB-INF/context/context-exampaper.xml]: 

   Instantiation of bean failed; 

 

   nested exception is org.springframework.beans.BeanInstantiationException: 

     Could not instantiate bean class 

     [com.es.business.sys_exampaper.service.impl.ExampaperServiceImpl]: 

       Is it an abstract class?; 


nested exception is java.lang.InstantiationException


==========================================================================

看异常从最后一个嵌套异常开始看。

实例化异常,

什么导致的?

无法实例话bean,

为什么?

倒数第二句,它是一个抽象类么?


原来我不小心把这个类定义成了抽象类。


解决方法:删掉类名前abstract的定义。


上一篇:java.lang.NullPointerException
下一篇:java.lang.NoClassDefFoundError