I am having an issue with one Action that I have defined with
struts. Whenever I try to call the action I get the following error:
No action instance for path /Purchase could be created
java.lang.ClassNotFoundException: com.catalyst.controller.commmands.PurchaseCommand
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:119)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:145)
at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:282)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:220)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
I have several other actions that are similar, none of the other classes have this problem. Here are the excepts for this action from the strtus-config.xml file.
<action path="/Purchase"
type="com.catalyst.controller.commmands.PurchaseCommand"
name="purchaseForm"
scope="request"
validate="true"
input="/purchase.jsp">
<forward name="PurchaseSuccess" path="/receipt.jsp"/>
<forward name="PurchaseError" path="/login.jsp"/>
</action>
<form-bean name="purchaseForm" type="com.catalyst.model.beans.TransactionBean"/>
The validation form works correctly, so I will only include the code for PurchaseCommand.
package com.catalyst.controller.commands;
public class PurchaseCommand extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
return mapping.findForward("PurchaseError");
}
}
The only difference between this class and any other class that I have defined is that the TransactionBean does not directly extend ActionForm. I don't know if this could cause a problem with the action or not. I have tried several different things over the last several days and cannot seem to get this Action to work. Any help in this matter would be greatly appreciated.
Thanks,
Chris Parkins