• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

No action instance for path could be created

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic