File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes got stuck in running my first struts example. help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "got stuck in running my first struts example. help" Watch "got stuck in running my first struts example. help" New topic

got stuck in running my first struts example. help

sonali rao
Ranch Hand

Joined: Nov 03, 2003
Posts: 64
Hi again
I am trying since 2 days to get rid of the ClassNotFoundException and implemented the advice which i got from a couple of people in this site but that dint solve my problem.
I have struts.jar placed in lib dir and not in classpath.
I am able to run successfully the examples which i get with struts documentation. does this mean that my classpath is set correctly and something is going wrong with the code in my application.
Following is the code of the appl which i am trying to run.
following is the partial code of web.xml
<display-name>Struts Blank Application</display-name>

<!-- Standard Action Servlet Configuration (with debugging) -->

<!-- Standard Action Servlet Mapping -->
following is the code of struts-config.xml
<action path="/register"
<forward name="success"
following is the code of
package coreappl;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class LoginAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

following is the code of Login.jsp
<!DOCTYPE ...>
<HEAD><TITLE>New Account Registration</TITLE></HEAD>
<H1>New Account Registration</H1>
Email address: <INPUT TYPE="TEXT" NAME="email"><BR>


following is the code of result.jsp
<head> </head>
<h1> Login Successful </h1>
I get the following error in tomcat
No action instance for path /register could be created
java.lang.ClassNotFoundException: coreappl.LoginAction
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

Does LoginAction compile and is the class file in /WEB-INF/classes/coreapp/LoginAction?

[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
sonali rao
Ranch Hand

Joined: Nov 03, 2003
Posts: 64
Yes LoginAction compiles and the class is in
M Miller

Joined: Mar 02, 2004
Posts: 8
If you are a newbie to struts (like me) try this example to learn from.

Struts Tutorial that is found on the Struts website:
There is an error with one of the examples that will cause an error. Look here how to solve the problem. Hope that helps!
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Did you try the examples from the JavaRanch journal?

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: got stuck in running my first struts example. help
It's not a secret anymore!