| 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: 219
|
|
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: 219
|
|
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: 219
|
|
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?
|
 |
 |
|
|
subject: Struts is not getting the action file. Throwing class not found exception - struts 1.3
|
|
|