Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat problem

 
Anil Chatty
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anil Chatty
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://localhost:8080/TestApp/testHtml.htlm

What happens if you change testHtml.htlm with testHtml.html ?
 
Anil Chatty
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HAHA, nice try but that was just a typo here. but thats not the case
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Suman Sharma
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anil, have you tried using localhost without 8080 as below. It works for my examples.

http://localhost/TestApp/testHtml.html
 
Anil Chatty
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic