Tuesday, November 3, 2009

Struts2: type Exception report

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Unable to instantiate Action, com.action.LoginAction,  defined for 'login' in namespace '/'null - action - file:/C:/apache-tomcat-6.0.14/webapps/WebProject/WEB-INF/classes/struts.xml:23:75
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:518)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)

root cause

Unable to instantiate Action, com.action.LoginAction,  defined for 'login' in namespace '/'null - action - file:/C:/apache-tomcat-6.0.14/webapps/WebProject/WEB-INF/classes/struts.xml:23:75
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:289)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:360)
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:78)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:70)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:66)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)

root cause

java.lang.NullPointerException
com.LoginAction.<init>(LoginAction.java:35)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
java.lang.Class.newInstance0(Class.java:355)
java.lang.Class.newInstance(Class.java:308)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:121)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:152)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:141)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:111)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:270)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:360)
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:78)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:70)
com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:66)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.


Apache Tomcat/6.0.14

1 comment:

  1. check you project source class files for any compilation problems, or that the qualifier provided for Action class is correct. it's just about checking if the Action class along with it's package is correct or not.

    ReplyDelete