无法实例化Action,com.hcl.hips.action.KaList,

时间:2011-10-03 14:06:57

标签: java spring

  

可能重复:
  Unable to instantiate Action, com.hcl.hips.action.KAListproduct, defined for 'KAListproduct' in namespace '/'com.hcl.hips.action.KAListproduct

Unable to instantiate Action, com.hcl.hips.action.KaList,  defined for 'KaList' in namespace '/'Error creating bean with name 'com.hcl.hips.action.KaList': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.hcl.hips.action.KaList]: Constructor threw exception; nested exception is java.lang.NullPointerException
        at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:306)
        at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:387)
        at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
        at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
        at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
        at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
        at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
        at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at net.sf.j2ep.ProxyFilter.doFilter(ProxyFilter.java:91)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.hcl.hips.action.LoginFilter.doFilter(LoginFilter.java:110)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
        at java.lang.Thread.run(Thread.java:619)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.hcl.hips.action.KaList': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.hcl.hips.action.KaList]: Constructor threw exception; nested exception is java.lang.NullPointerException
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:308)
        at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154)
        at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:129)
        at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
        at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)
        at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:287)
        ... 26 more
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.hcl.hips.action.KaList]: Constructor threw exception; nested exception is java.lang.NullPointerException
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248)
        ... 33 more
    Caused by: java.lang.NullPointerException
        at com.hcl.hips.action.KaList.(KaList.java:16)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
        ... 35 more

请帮我解决这个错误..

先谢谢..

1 个答案:

答案 0 :(得分:0)

您的错误在堆栈跟踪中描述

Could not instantiate bean class [com.hcl.hips.action.KaList]: Constructor threw exception; nested exception is java.lang.NullPointerException

当容器尝试创建它时,构造函数抛出异常。