jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Struts is not getting the action file. Throwing class not found exception - struts 1.3 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 "Struts is not getting the action file. Throwing class not found exception - struts 1.3" Watch "Struts is not getting the action file. Throwing class not found exception - struts 1.3" New topic
Author

Struts is not getting the action file. Throwing class not found exception - struts 1.3

Salil Vverma
Ranch Hand

Joined: Sep 06, 2009
Posts: 253

Hi,

I have made one simple application in which it will take values in one from and print that value in another jsp. but while clicking on submit button


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.ClassNotFoundException: HtmlFromAction

root cause

java.lang.ClassNotFoundException: HtmlFromAction

note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server Platform Edition 9.0_01 logs.
Sun Java System Application Server Platform Edition 9.0_01
Sun Java System Application Server Platform Edition 9.0_01 - Error report



HtmlFormAction.class exists in WEB-INF\classes directory. and it code is as follows -



The code of other two jsps and struts-config.xml is as follows -
FirstCall.jsp - This file would be called at first



HtmlFormValues.jsp - The action would forward the control to this jsp at last



entries in struts-config.xml



Can somebody help me to resolve this problem ?


Regards
Salil Verma
Ranveer K Kumar
Ranch Hand

Joined: Sep 13, 2009
Posts: 64
check Action type in in struts-confige.xml.

<Action type="HtmlFromAction"> is this valid ?

please check the package structure.

Salil Vverma
Ranch Hand

Joined: Sep 06, 2009
Posts: 253

Hey Ranveer,
Thanks for you reply but I have not put HtmlFromAction class in any of the package, it is directly inside WEB-INF\classes directory.
Salil Vverma
Ranch Hand

Joined: Sep 06, 2009
Posts: 253

Hey Ranveer,

The issue is resolved now. What I noticed that if we keep the class files in default package it does not work and give the class not found exception. If we keep the class in a specific package and update the struts-config.xml to include the package name as well in type, it works fine.

Still it is not clear to me why, but I know that it's working fine for me now. Could you give your thoughts on it, if you have some idea?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts is not getting the action file. Throwing class not found exception - struts 1.3
 
Similar Threads
Not able to set attribute in JSP
Handling multiple form data in struts2
include directive doesn't work
Struts question
Could not find action or result