Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Exception in ForwardAction

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Prasad",
Please check your private messages regarding an important administrative matter.
Your account is about to be closed.
-Ben
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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'.
 
reply
    Bookmark Topic Watch Topic
  • New Topic