wood burning stoves 2.0*
The moose likes Tomcat and the fly likes tomcat problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat problem" Watch "tomcat problem" New topic
Author

tomcat problem

Anil Chatty
Greenhorn

Joined: Jun 12, 2007
Posts: 21
i installed tomcat on a windows machine. when i say http://localhost:8080
i get the tomcat home page. but when i put my webapp folder called TestApp
in the tomcats webapp folder and try to view a html page in it i get 404-file not found error.

what is the problem? and how can i fix it?


SCJP 5.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

What exactly did you put in your TestApp folder, and how did you try to access it ? Please post the directory stucture you have, and the URL you're trying to access as well.


[My Blog]
All roads lead to JavaRanch
Anil Chatty
Greenhorn

Joined: Jun 12, 2007
Posts: 21
...tomcat/webapps/TestApp is the location of my application.
...tomcat/webapps/TestApp/testHtml.html is the file i am trying to access

http://localhost:8080/TestApp/testHtml.htlm , this is what i type in the address bar. tomcat is running...i know this because i started the tomcat service and also tested it by typing in http://localhost:8080 which took me to tomcat home page on my machine.

so, what did i do wrong or did i not configure tomcat properly?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

http://localhost:8080/TestApp/testHtml.htlm

What happens if you change testHtml.htlm with testHtml.html ?
Anil Chatty
Greenhorn

Joined: Jun 12, 2007
Posts: 21
HAHA, nice try but that was just a typo here. but thats not the case
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

nice try but that was just a typo here

Hence the importance of giving correct information to people helping you

Did you restart Tomcat ?
Anil Chatty
Greenhorn

Joined: Jun 12, 2007
Posts: 21
yes i have restarted the server many times.

i am using tomcat 5.0.28. the only thing i did was to run the installer.
now, do i have to set any environment variables? or do i have to configure any batch file in the tomcat's bin directory like the catalina.bat file?

the folder TestApp is in webapps folder. it contains WEB-INF,which in turn contains two folders. classes and lib. there is a web.xml file inside WEB-INF folder. i have put the test html file inside TestApp folder.

when i type http://localhost:8080/TestApp

i get 404-requested resource not available.

what am i doing wrong (assuming that there are no typo )?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Could you try to rename your directories and files, and use only lowercase letters ? I'm not sure it's the cause of your problems, but it might be.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Here are the two things I would do to debug this problem.

1.) Use the Tomcat Manager application to see if your application has been deployed.
http://localhost:8080/manager/html

If you haven't already set up a manager username and password, you can do so by editing the tomcat/conf/tomcat-users.xml file.

2.) If it hasn't been deployed or if it has but still isn't showing your page, look at the Tomcat logs under tomcat/logs.
If there are a lot of log files in there or if the files are large; stop tomcat, delete all the logs, start tomcat, try hitting your page again, then check the logs if it doesn't work. You should either see some deployment errors or some runtime errors.


I'm guessing, since you said that you've put a web.xml file under WEB-INF that there could be an xml syntax error in that file that has kept your application from being deployed correctly. The logs will point this out to you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Suman Sharma
Ranch Hand

Joined: May 16, 2005
Posts: 72
Anil, have you tried using localhost without 8080 as below. It works for my examples.

http://localhost/TestApp/testHtml.html
Anil Chatty
Greenhorn

Joined: Jun 12, 2007
Posts: 21
Hello,

thanks for all your suggestions, but it turns out that i did not set CATALINA_HOME to tomcats root directory as a system variable. once i did it , my html page magicaly started to work !!!
 
jQuery in Action, 2nd edition
 
subject: tomcat problem
 
Similar Threads
tomcat running but gives an Invalid HTTP get error
configuring struts with tomcat 6.0
Tomcat 6.0 and Axis 1.4 XML Security Error
Tomcat Welcome ROOT web app problems - only some content displaying
how to get administrative form on jboss