File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Need Help in running a struts applicaton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need Help in running a struts applicaton" Watch "Need Help in running a struts applicaton" New topic

Need Help in running a struts applicaton

Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
Hi all

I am trying to run a sample application called miniHR.
Its give in the book Struts Complete Reference.
But when i try to run the application, using the URL

http://localhost:8080/index.jsp and click on the link
Search Employees, I get this exception in the browser -

javax.servlet.ServletException: Cannot retrieve definition for form bean searchForm on action /search

I have checked and rechecked the struts-config.xml file and everything seems to be all right.

I am uploading the code on this link download code

This link will take you to a website called
Scroll down and click on the FREE button to download the code.

Please help
Thanks in advance.

SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

In the Struts config XML, SearchAction takes a SearchForm. Where is the form on index.jsp that is getting passed to it?

In the future (or for follow ups to this question), please post the relevant code snippets in the forum. It's a lot of steps to download this large zip file - which discourages people from looking at the problem.

In this case, the relevant files would be the XML and the index.jsp.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi Niranjan,

Your expception basically tells that the Form Bean has not been associated correctly with struts-config or it is not present in the classes folder. There may be some typos also which are the most un-noticable errors.
This link gives a great refernce to the common struts errors. This should be helpful for common errors.

If some problem exists, please post the JSP, action class adn struts-config.

Regards,<br />Roshani
I agree. Here's the link:
subject: Need Help in running a struts applicaton
It's not a secret anymore!