wood burning stoves
The moose likes Tomcat and the fly likes Problem with Tomcat 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem with Tomcat 5" Watch "Problem with Tomcat 5" New topic

Problem with Tomcat 5

Ritu varada
Ranch Hand

Joined: Sep 08, 2004
Posts: 117
Hi, I have used tomcat 4 before and I cannot imagine that I cannot solve such a small thing. Anyway, I thought I must be missing something.Ok, here is the problem. I installed Tomcat5 under c:/tomcat5 (to make sure I don't mess with dos naming). I wrote a form.html which I placed under c:/tomcat5/webapps/test/form.html. I started tomcat and went to http://localhost:8080/test/form.html. I am getting a 404 error. I placed the same html file under c:/tomcat5/webapps/ROOT/form.html and I can access it from http://localhost:8080/form.html. What am I doing wrong ? I know its a really basic thing but I have wasted over 2 hours of my time and didn't think it was worth it. So, if anybody can help, I would appreciate it! Thanks!

Michael Talavera

Joined: Jul 26, 2004
Posts: 5
In your test folder under your webapps directory, do you have a WEB-INF directory within your test folder? Tomcat must see a WEB-INF folder inside your application, or else it will not register the application I have found. I recreated your problem my adding a test1 directory to webapps, then placed an html document under test1 called test1.htm. If I don't have an WEB-INF directory under test1, then Tomcat throws the 404 error. Once I add the WEB-INF, then restart Tomcat, everything is fine. Try adding a WEB-INF folder underneath your test folder. Then restart the Tomcat server and try http://localhost:8080/test/form.html again. Make sure you take out the form.html from the ROOT directory, or else you won't know which one is really working. Hopefully this helps.
Ritu varada
Ranch Hand

Joined: Sep 08, 2004
Posts: 117
Wow! You are so right ! I did not know that! I put a WEB-INF file and it works! Thank you so much!
I agree. Here's the link: http://aspose.com/file-tools
subject: Problem with Tomcat 5
It's not a secret anymore!