Could not instantiate bean class [com.wms.web.action.inquiry.ItemQueryAction]: Constructor threw exc
来源:互联网 发布:c语言graphics图库 编辑:程序博客网 时间:2024/05/20 18:17
[framework] 2012-03-04 14:00:08,187 - org.springframework.web.context.ContextLoader -16 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ItemQueryAction' defined in ServletContext resource [/WEB-INF/applicationContext_inquiry.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.wms.web.action.inquiry.ItemQueryAction]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:813)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:769)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ItemQueryAction' defined in ServletContext resource [/WEB-INF/applicationContext_inquiry.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.wms.web.action.inquiry.ItemQueryAction]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:813)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:769)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:412)
采用的框架是:struts2 + hibernate3 + spring2.0
原因 :
在/WEB-INF/applicationContext_inquiry.xml 配置action的时候,使用的是:
<bean name="ItemQueryAction"
class="com.wms.web.action.inquiry.ItemQueryAction">
<property name="itemDao">
<ref bean="ItemDAOProxy"/>
</property>
</bean>
而不是:
<bean name="ItemQueryAction"
class="com.wms.web.action.inquiry.ItemQueryAction" scope="prototype">
<property name="itemDao">
<ref bean="ItemDAOProxy"/>
</property>
</bean>
故报错。
- Could not instantiate bean class [com.wms.web.action.inquiry.ItemQueryAction]: Constructor threw exc
- Could not instantiate bean class [com.book.action.addAction]: Constructor threw exception; nested ex
- Could not instantiate bean class [java.util.Date]: Constructor threw exception; nested exception is
- SpringMVC 页面传Date类型值提示Could not instantiate bean class [java.util.Date]: Constructor threw exception
- Could not instantiate bean class [com.bjsxt.service.UserService]: No default constructor found;
- Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class
- Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class
- Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class
- springmvc+fileuploader上传报错 Could not instantiate bean class [org.springframework.web.multipart.Multi
- Could not instantiate bean class [org.hibernate.cfg.Configuration]: Construct
- 错误:Could not instantiate bean class [java.util.List]: Specified class is an interface
- mybatis报错:Could not instantiate bean class [Dao.stuDao]: Specified class is an interface
- Could not instantiate bean class [javax.servlet.ServletContext]: Specified class is an interface
- Could not instantiate bean class [java.util.List]: Specified class is an interface
- 【FAQ】SpingMVC实现集合参数(Could not instantiate bean class [java.util.List])
- SSH配置启动后Tomcat后报错:Could not instantiate bean class [org.hibernate.cfg.Configuration]
- 【FAQ】SpingMVC实现集合参数(Could not instantiate bean class [java.util.List])
- Could not instantiate class named NSLayoutConstraint
- C#中不常用的数据结构
- 电影并不是演戏
- SAP BW_PA_文件_特征数据——视频学习笔记13
- HDU 1698(Just a Hook )
- Java堆内存的10个要点
- Could not instantiate bean class [com.wms.web.action.inquiry.ItemQueryAction]: Constructor threw exc
- AndroidPN环境建立
- spring学习总结
- OD在Windows 7 x64下无法调试的原因
- Android培训班(93)内核解压过程6
- 用户sa登录失败,该用户与可信sql server连接无关联
- SAP BW_PA_文件_层级数据——视频学习笔记14
- HttpURLConnection用法详解
- 用思维导图和实例学习之——Web Service