File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Problem running Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem running Servlet" Watch "Problem running Servlet" New topic
Author

Problem running Servlet

Muhammad Saghir
Greenhorn

Joined: Mar 06, 2002
Posts: 6
Hi Guys
I installed and configured the tomcat4.0.I tested it and is o.k.It works for html and jsp but it gives me error 404 for HelloServlet.
my window is 2000 professional.
CATALINA_HOME = d:\tomcat4\tomcat
My development directory is "servletsdevel"
I created the dir"classes" under ROOT\WEB-INF.
can you please write me the correct "CLASSPATH" AND CATALINA_HOME variable.
I have jdk1.4.
Any help will be appreciated
[ May 01, 2002: Message edited by: Muhammad Saghir ]

Saghir SCJP2
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

CATALINA_HOME should be the directory that contains (among many others) the following folders:
bin
conf
lib
logs
webapps

CLASSPATH does not matter *at all* except when you compile a servlet through an IDE or Textpad.

JAVA_HOME should be set to the root of your jdk1.4 (most likely something like C:\jdk1.4)

For development "best practices" read the following two pages:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/deployment.html
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/source.html
Muhammad Saghir
Greenhorn

Joined: Mar 06, 2002
Posts: 6
Thanks Mike for the reply
but still i have some confusion
i tried to understand the links but i could't.My question is where i will create the CATALINA_HOME directory and what is the relations b/t my installation directory and development directory.
My isntallation directory is D:\tomcat4\tomcat
My development directory is D:\servletsdevel
what will be my CATALINA_HOME variable.
Thanks for help
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Your CATALINA_HOME *always* points to the tomcat installation. It is a system variable used by the Tomcat startup scripts, so it must always point to Tomcat.

As for the development directory, is there a good reason you're not developing right in the instance of Tomcat ? I mean... why not do something like this?

CATALINA_HOME
|-webapps
|- mywebappName

mywebappName is the directory used to store all your files for the 'mywebappName' application. This way, there is no difficulty in 'moving' your files between development and deployment directories - they are the same! Your development directory becomes a live test environment.

The only reason not to do this, is if the box we're talking about is a 'live' production box. Otherwise, since it's your development box, why not develop your application right inside Tomcat?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem running Servlet
 
Similar Threads
Problem starting Tomcat 4.1.31 on Mac OS X
Tomcat 5.5.23
CATALINA_BASE?
Integrating Tomcat with Eclipse 2.1.1
variable substitution in log4j properties file