OK, well I figured it out and apparently I
have been staring at this screen a little too long. J I turned on jpda
in tomcat and debugged through FilterDispatcher and
discovered that the code in there would almost always disregard all of my
results (except input) if the class was not ServletDispatcher
(BTW, this is the part that confuses me since these errors happen at deploy
time, not when I execute the action). This struck me as a little odd. So, I traced it a little further and found
that, in this case, if you did not have an input result that you would always get
a NullPointerEx.
In FilterDispatcher, around line 130, the
success result is ignored and the input result is queried. If there is no input result then line
195 will give a NPE. Now, I haven’t
spent the time to determine why I should have never gotten in this section of
the code (though I would love to know the function of FilterDispatcher
if someone can explain it in less time than it would take me to read J). So, I stuck an input
result in my action and the problem was solved. Now, I will likely need this result at
some point. However, I’m not
sure it’s presence should be a requirement. Anyway, someone may want to look at this
section and at least trap this NPE and provide a slightly more meaningful
message (like please include an input result J ) or whether they should check for null of the resultConfig. Thanx, LES -----Original Message----- I’ve run into a problem when
trying to chain from one action to another. Whenever I try to load the following
configuration, I get a NullPointerException in the FilterDispatcher(195). However, when I run the same
configuration via unit tests (using ActionProxy) it works fine – chaining
the actions correctly. The stack
trace is below the xwork.xml. Can any body help?? <!-- ====================== xwork.xml
=================================--> <!DOCTYPE xwork PUBLIC "-//OpenSymphony
Group//XWork 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-1.0.dtd"> <xwork> <package
name="default"> <result-types> <result-type
name="dispatcher"
class="com.opensymphony.webwork.dispatcher.ServletDispatcherResult"/> <result-type
name="redirect"
class="com.opensymphony.webwork.dispatcher.ServletRedirectResult"/> <result-type
name="velocity" class="com.opensymphony.webwork.dispatcher.VelocityResult"/> <result-type
name="chain"
class="com.opensymphony.xwork.ActionChainResult"/> </result-types> <interceptors> <interceptor
name="timer"
class="com.opensymphony.xwork.interceptor.TimerInterceptor"/> <interceptor
name="logger" class="com.opensymphony.xwork.interceptor.LoggingInterceptor"/> <interceptor
name="chain"
class="com.opensymphony.xwork.interceptor.ChainingInterceptor"/> <interceptor
name="static-params"
class="com.opensymphony.xwork.interceptor.StaticParametersInterceptor"/> <interceptor
name="params"
class="com.opensymphony.xwork.interceptor.ParametersInterceptor"/> <interceptor
name="validator"
class="com.opensymphony.xwork.validator.ValidationInterceptor"/> <interceptor
name="component" class="com.opensymphony.xwork.interceptor.component.ComponentInterceptor"/> <interceptor
name="token"
class="com.opensymphony.webwork.interceptor.TokenInterceptor"/> <interceptor
name="token-session"
class="com.opensymphony.webwork.interceptor.TokenSessionStoreInterceptor"/> <interceptor-stack
name="defaultStack"> <interceptor-ref
name="timer"/> <interceptor-ref
name="logger"/> <interceptor-ref
name="component"/> <!--
<interceptor-ref name="static-params"/>--> <interceptor-ref
name="params"/> <interceptor-ref
name="validator"/> </interceptor-stack> </interceptors> <action
name="ListAllPeople"
class="com.les.mydirector.actions.teammanagement.ListAllPeopleAction"> <result
name="success" type="dispatcher"> <param
name="location">teammanagement/listAllPeople.jsp</param> </result> <interceptor-ref
name="defaultStack"/> </action> <action
name="AddPerson"
class="com.les.mydirector.actions.teammanagement.AddPersonAction"> <result
name="success" type="chain"> <param
name="actionName">ListAllPeople</param> </result> <interceptor-ref
name="defaultStack"/> </action> </package> </xwork> <!-- ============================ Stack Trace
======================================== --> 2003-06-08
java.lang.NullPointerException at
com.opensymphony.webwork.dispatcher.FilterDispatcher.getActionResultConfig(FilterDispatcher.java:195) at
com.opensymphony.webwork.dispatcher.FilterDispatcher.init(FilterDispatcher.java:132) at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266) at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:327) at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120) at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3158) at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3602) at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821) at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:307) at
org.apache.catalina.core.StandardHost.install(StandardHost.java:772) at
org.apache.catalina.servlets.ManagerServlet.deploy(ManagerServlet.java:564) at
org.apache.catalina.servlets.ManagerServlet.doPut(ManagerServlet.java:413) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:551) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at
java.lang.Thread.run(Thread.java:536) |