This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Exception in ForwardAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception in ForwardAction" Watch "Exception in ForwardAction" New topic
Author

Exception in ForwardAction

Prasad Prabha
Greenhorn

Joined: Nov 26, 2008
Posts: 8
hey all,

I tried to run my application using struts ...but ended up with the below exception

exception

javax.servlet.ServletException: org.apache.struts.action.ForwardAction
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.ClassNotFoundException: org.apache.struts.action.ForwardAction
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
org.apache.struts.chain.commands.util.ClassUtils.getApplicationClass(ClassUtils.java:54)
org.apache.struts.chain.commands.util.ClassUtils.getApplicationInstance(ClassUtils.java:71)
org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:90)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

My index.jsp file is

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<body>
<a href="http://localhost:80/ForwardDemo/move.do">
Click here to forward
</a>
</body>
</html:html>

My struts-config.xml is given below


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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="loginform" type="com.example.web.LoginForm"/>
</form-beans>

<global-forwards>
<forward name="failure" path="/jsp/Sorry.jsp"/>
</global-forwards>


<action-mappings>
<action path="/move" type="org.apache.struts.action.ForwardAction" name ="loginform" parameter="/jsp/Login.jsp"/>

<action path="/login" type="com.example.web.LoginAction" name="loginform" parameter="operation">
<forward name="success" path="/jsp/Welcome.jsp"/>
</action>

<action path="/langset" type="com.example.web.LangAction" name="loginform">
<forward name="success" path="/jsp/Login.jsp"/>
</action>
</action-mappings>

<message-resources parameter="MessageResources" null="false"/>

</struts-config>


Could anyone help me in sorting out this problem???
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Prasad",
Please check your private messages regarding an important administrative matter.
Your account is about to be closed.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
I think the problem is with this line in your struts-config file:

<action path="/move" type="org.apache.struts.action.ForwardAction" name ="loginform" parameter="/jsp/Login.jsp"/>

I checked the API for struts 1.3.8 and the correct package for ForwardAction is org.apache.struts.actions - You're missing the last 's'.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in ForwardAction
 
Similar Threads
issue in calling the Action class
status 500 :java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
Unable to forward using tiles
HI
Problem running a simple webapplication in struts