This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem running Servlet" Watch "Problem running Servlet" New topic

Problem running Servlet

Muhammad Saghir

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:

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:
Muhammad Saghir

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?

|- 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?
subject: Problem running Servlet
It's not a secret anymore!