File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes 404 File not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "404 File not found" Watch "404 File not found" New topic

404 File not found

hemant chaudhary

Joined: Feb 22, 2007
Posts: 20
I have created one application folder as

C:\Program Files\Apache Software Foundation\Tomcat 4.1\webapps\oneapp

and saved one html file in it like this:

C:\Program Files\Apache Software Foundation\Tomcat 4.1\webapps\oneapp\form1.html

and tried running tomcat like this:


What I m getting is :

HTTP Status 404 - /Beer/form.html

type Status report

message /Beer/form.html

description The requested resource (/Beer/form.html) is not available.
Apache Tomcat/4.1.34


when i m saving same form1.html as index.html in ROOT directory,it is working fine on running like this :


Can somebody tell me why it is happening.
[ September 16, 2007: Message edited by: Bear Bibeault ]
hemant chaudhary

Joined: Feb 22, 2007
Posts: 20
One more doubt

when i m trying to access index file like this :

http://localhost:8080...its working.

but when i m trying to access it like this :


it is again giving 404 error

Please enlighten me.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183
A web application has four parts:

A public directory
A WEB-INF/web.xml file
A WEB-INF/classes directory
A WEB-INF/lib directory

The public area is the root of the application, excluding the WEB-INF directory. In your case it's located at C:\Program Files\Apache Software Foundation\Tomcat 4.1\webapps\ROOT

If you place form1.html there http://localhost:8080\form1.html will serve it.

You can go ahead and create the directory
C:\Program Files\Apache Software Foundation\Tomcat 4.1\webapps\ROOT\beer

And place there the form.html file.

http://localhost:8080\beer\form.html will serve it.


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I agree. Here's the link:
subject: 404 File not found
It's not a secret anymore!