IntelliJ Java IDE
The moose likes Struts and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark ""The path of an ForwardConfig cannot be null" error in Second run" Watch ""The path of an ForwardConfig cannot be null" error in Second run" New topic
Author

"The path of an ForwardConfig cannot be null" error in Second run

Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50
Hi,


I am getting the "The path of an ForwardConfig cannot be null" error while running the Struts web application for the second time.

I can run my web application successfully in first attempt, but getting the below error after first run.

org.apache.struts.chain.commands.AbstractExceptionHandler execute Unhandled exception
java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
Please help me to fix this issue.


Thanks,
Rajesh.B
Vicky Vijay
Ranch Hand

Joined: Apr 23, 2008
Posts: 123
Can you post your struts-config mapping ??


Check the below,

1. Did you enable the validation turned on ???

2. Have you provided the "input" attribute.. ??? If not , set this and check it !!

Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50
Hi,


I have not turned on the "Validate" as i am not using the validation.

Still do i need to turn it on?


And i have set the input attribute.


Thanks,
Rajesh.B
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50

Here is my Struts-config file.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>

<form-beans>
<form-bean name="selectionForm" type="allstate_travel.forms.SelectionForm">
</form-bean>
<form-bean name="MailForm" type="allstate_travel.forms.EMailForm">
</form-bean>
<form-bean name="fileUploadForm" type="allstate_travel.forms.FileUploadForm">
</form-bean>
</form-beans>

<global-exceptions>
</global-exceptions>

<global-forwards>
<forward name="Success" path="/Output.jsp" />
<forward name="Previous" path="/Output.jsp" />
<forward name="Excel" path="/OutputbyExcel.jsp" />
<forward name="Back" path="/Selection.jsp" />
<forward name="Home" path="/Selection.jsp" />
<forward name="mail" path="/FileUpload.jsp" />
</global-forwards>

<action-mappings>
<action path="/Select" type="allstate_travel.actions.SelectionAction"
name="selectionForm" scope="session" validate="true" input="/Selection.jsp">
</action>
<action path="/mail" type="allstate_travel.actions.MailAction"
name="MailForm" scope="session" validate="true" input="/Output.jsp">
</action>
<action path="/strutsUploadAndSave"
type="allstate_travel.actions.StrutsUploadAndSaveAction" name="fileUploadForm"
scope="session" validate="true" input="/FileUpload.jsp">
<forward name="success" path="/TestAttach.jsp"></forward>
</action>
</action-mappings>
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 278

Hi Rajesh, Also provide the JSP and Action class method code snippet to see what exactly is happening. Also let us know what exactly meant by second time.

Please use 'code' tags to insert your code. Its really good to read.


Have Fun with Java
little,little.. little by little makes a lot..
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50
JSP PAGE









ACTION CLASS


Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50
Hi,


Second run means, running the application for the second time.
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50
Hi,


Could you please help on this?


Thanks,
Rajesh.B
Sanjeev Kumar Ramineni
Greenhorn

Joined: Jul 14, 2010
Posts: 10
Hi Rajesh,

Can you paste the contents of the log?

Regards,
Sanjeev.
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 50
Hi,


Here is the error.

[1/30/12 21:24:35:126 IST] 0000002d SystemOut O The test nullnullnull
[1/30/12 21:24:35:126 IST] 0000002d SystemOut O The Time is: null
[1/30/12 21:24:35:141 IST] 0000002d PropertyMessa W org.apache.struts.util.PropertyMessageResources loadLocale Resource org/apache/struts/action/ActionResources_en_US.properties Not Found.
[1/30/12 21:24:35:157 IST] 0000002d PropertyMessa W org.apache.struts.util.PropertyMessageResources loadLocale Resource org/apache/struts/action/ActionResources_en.properties Not Found.
[1/30/12 21:24:35:173 IST] 0000002d AbstractExcep W org.apache.struts.chain.commands.AbstractExceptionHandler execute Unhandled exception
java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:70)
at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1455)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:793)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:444)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:860)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1566)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:175)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

[1/30/12 21:24:35:235 IST] 0000002d ExceptionCatc W org.apache.struts.chain.commands.ExceptionCatcher postprocess Exception from exceptionCommand 'servlet-exception'
java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:70)
at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1455)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:793)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:444)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:860)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1566)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:175)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

[1/30/12 21:24:35:235 IST] 0000002d servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet action in application TravelRequestEAR. Exception created : javax.servlet.ServletException: java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1455)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:793)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:444)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:860)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1566)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:175)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:70)
at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
... 23 more

[1/30/12 21:24:35:251 IST] 0000002d webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[action]: java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:70)
at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1455)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:793)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:444)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:860)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1566)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:175)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Sanjeev Kumar Ramineni
Greenhorn

Joined: Jul 14, 2010
Posts: 10
Hi Rajesh,

Based on the log, I could see that selname variable got resolved to null. So when you try to do selname.length in the for loop, a NullPointerException would be thrown and the control would go to catch block after which an empty forward is being thrown.
I guess this is the reason why you are getting the below exception

SRVE0293E: [Servlet Error]-[action]: java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null

So, please check why the selname variable is getting resolved to null?

Regards,
Sanjeev.

 
 
subject: "The path of an ForwardConfig cannot be null" error in Second run
 
Threads others viewed
How can I change the struts-config.xml dynamicly?
Class Not Found Exception
Doubt in Action messages
Get rid of line numbers
status 500 :java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
developer file tools