aspose file tools*
The moose likes Struts and the fly likes No action instance for path could be created Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No action instance for path could be created" Watch "No action instance for path could be created" New topic
Author

No action instance for path could be created

Chris Parkins
Greenhorn

Joined: Apr 14, 2005
Posts: 1
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
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Every time I've had that error, its been something in the struts-config file or the way I referenced the action in the page. Often its a name thing, refering to the name incorrectly. How do you call the action in the page?
Is it in a form? a link? or?


-Tad
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
given:
java.lang.ClassNotFoundException: com.catalyst.controller.commmands.PurchaseCommand

my first steps would be: make sure the class is where I said it would be, has the proper package statement, and has compiled properly.

As long as TransactionBean has ActionForm in it's hierarchy, it's fine. (My first form is typically BaseForm, which most of my other forms extend. If I need a place for a common method, I have somewhere to put it)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No action instance for path could be created