• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat index page is not opening even though tomcat is running

 
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am using windows 7. i have tomcat 6. under bin folder i ran startup.bat and it is running and it says server started. but when i tried to open the index page i.e http://localhost:8080/ it is not showing anything it just says http status 404 error. what i got wrong here?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Logically, if you got a 404 error then a server is running on port 8080.

Therefore we must look elsewhere. Your base web.xml file (in the Tomcat conf directory) should have a welcome file list:



So do you have one of those files under the webapps\ROOT directory?

Bill
 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i do have them in webapps\ROOT directory index.jsp,index.html. then why it is not working? and one more thing is tomcat service is not showing under services in windows7. does this mean anything?
 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can some one clear my problem. i have gone through net but any resolution is not working for me.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kiran kumar reddy wrote: and one more thing is tomcat service is not showing under services in windows7. does this mean anything?



How have you started Tomcat? Are you sure that it's Tomcat which is currently running and not some other server (instance)?
 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brother the same problem happens with me & it has wasted hours. I don't see any logic the error keeps on coming like crazy.

Tomcat stops working it starts giving the error requested resource not found even for the projects it was working earlier. I close the eclipse restart the server thousand times. It doesn't work. And then after sometime it starts working on its own. I am really unable to comprehend the logic behind this.

Here is the scenario where I am stuck again.

I created a simple dynamic web project in eclipse. Put index.jsp under WebContent.

web.xml



On running the project the error is requested resource is not available. Even on running index.jsp directly it is displaying the same error. Can anyone help me out. Am I missing something?

Server console

 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for me it is running quite good in eclipse but outside eclipse it is not wotking. and i haven't tried localhost:8080 in eclipse internal browser,but my applications are running fine in eclipse browser.
 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:

kiran kumar reddy wrote: and one more thing is tomcat service is not showing under services in windows7. does this mean anything?



How have you started Tomcat? Are you sure that it's Tomcat which is currently running and not some other server (instance)?


went to bin folder under tomcat folder and opened startup.bat file. no other servers were installed in my pc.
 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please make sure only one project is deployed under tomcat if you are using eclipse. If more than one project is deployed, you will receive resource not available.
This is the problem which occured with me. Thanks guys for the reply
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that whatever you have set up in Eclipse is what gets run if you start that Tomcat? Eclipse would not generally know about other Tomcat installations on our machine.

To make sure that you're not running into that: Stop Eclipse, make sure that the files you have changed and want to run are part of the Tomcat installation you're about to start, and then start that Tomcat installation.
 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
+1 to your comment Ulf. This issue has troubled me beyond words
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

+1 to your comment Ulf.


The "+1" button looks like this: :-)
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shivang sarawagi wrote:Please make sure only one project is deployed under tomcat if you are using eclipse. If more than one project is deployed, you will receive resource not available.
This is the problem which occured with me. Thanks guys for the reply



There are at least two different ways to run Tomcat under Eclipse. Both of them allow running multiple webapps (projects) at the same time.

One is by using the WTP plugin that comes as part of the J2EE spin of Eclipse.

The other is by installing the sysdeo plugin for Tomcat.

The sysdeo plugin is my preference because it runs Tomcat using the actual Tomcat config files. The WTP plugin clones selected files from the Tomcat configuration and uses them. It also doesn't automatically update based on changes to the original configuration.

I've been burned more than once by WTP, which is why I recommend sysdeo even tough it requires separate download and installation instead of coming straight from the factory (so to speak). When you have 2 projects and only one of them is accessible, it's most likely because you didn't update your WTP configuration.
 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
atlast i am using it in my xp OS and tomcat successfully installed and ran very fine.

while trying a simple application i got this message "request resource is not available"i checked it my side but invain.

this is my application present in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\hello_app
and my .class file is present in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\hello_app\WEB-INF\classes folder
when i called my servlet using http://localhost:8080/hello_app/callmyservlet it is saying that request resource is not available, i checked it my side but invain. did i go wrong any where?

here is my web.xml file

 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One place you went wrong is that your servlet is in the default package.

That's bad practice for any Java class. But I think that in particular, Tomcat doesn't like servlets to be in the default package. I could be wrong about that, but the default package is still something to stay away from.
 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:One place you went wrong is that your servlet is in the default package.

That's bad practice for any Java class. But I think that in particular, Tomcat doesn't like servlets to be in the default package. I could be wrong about that, but the default package is still something to stay away from.


yes it is a BAD practise you said but it is not must rite. then why is it not running then? its kind of warnings while running a program but those wont stop running my program(here my application) rite?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is a must. Always put all classes in a package. See the ServletsFaq for more info.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:Logically, if you got a 404 error then a server is running on port 8080.

Therefore we must look elsewhere. Your base web.xml file (in the Tomcat conf directory) should have a welcome file list:



So do you have one of those files under the webapps\ROOT directory?

Bill




thank you, saved my time...
 
Talk sense to a fool and he calls you foolish. -Euripides A foolish tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic