Reputation: 1022
I integrated Tomcat 7 in Eclipse. When I start it using Eclipse, it shows that Tomcat is up and running, but when I go to http://localhost:8080 in my browser, it gives me following error:
HTTP Status 404 - /
type Status report
message /
description The requested resource (/) is not available.
Apache Tomcat/7.0.23
I tried changing the port in server.xml
just in case if 8080 is used by another service, but it didn't work either. How can I solve it?
Upvotes: 59
Views: 365098
Reputation: 16
Apache Tomcat/7.0.23 service is not loaded or enabled. Pls check the service status and other app which is using 8080 port currently. To check this use netstat command and observe whether another app is occupying the port 8080!
Upvotes: 0
Reputation: 2240
In my case, I've had to click on my project, then go to File
> Properties
> *servlet name*
and click Restart servlet
.
Upvotes: 1
Reputation: 183
This worked for me:
Upvotes: 0
Reputation: 2243
Following steps helped me solve the issue.
Upvotes: 38
Reputation: 173
Sometimes cleaning the server works. It worked for me many times.This is only applicable if the program worked earlier but suddenly it stops working.
Steps:
" Right click on Tomcat Server -> Clean. Then restart the server."
Upvotes: 3
Reputation: 705
I did what BalusC said but it was not enough for me, I had to clean the Tomcat workdirectory : ( Click right on right on Tomcat in the Servers Tab -> Clean Tomcat Work Directory )
Upvotes: 6
Reputation: 89
I had the same problem with my localhost project using Eclipse Luna, Maven and Tomcat - the Tomcat homepage would appear fine, however my project would get the 404 error.
After trying many suggested solutions (updating spring .jar file, changing properties of the Tomcat server, add/remove project, change JRE from 1.6 to 7 etc) which did not fix the issue, what worked for me was to just Refresh my project. It seems Eclipse does not automatically refresh the project after a (Maven) build. In Eclipse 3.3.1 there was a 'Refresh Automatically' option under Preferences > General > Workspace however that option doesn't look to be in Luna.
Upvotes: 1
Reputation: 962
For me, my Eclipse installation was hosed - I think because I'd installed struts. After trying a dozen remedies for this error, I re-installed Eclipse, made a new workspace and it was OK. Using Kepler-64-Windows, Tomcat 7, Windows 7.
Upvotes: 0
Reputation: 99
If options under Server Locations are grayed out, note the message in the section title: "Server must be published with no modules present". To publish the server, right click the name of the server in the Server window and select "Publish".
Upvotes: 3
Reputation: 161
Copy the ROOT (Default) Web App into Eclipse.
Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace.
Upvotes: 16
Reputation: 1108742
What are you expecting? The default Tomcat homepage? If so, you'll need to configure Eclipse to take control over from Tomcat.
Doubleclick the Tomcat server entry in the Servers tab, you'll get the server configuration. At the left column, under Server Locations, select Use Tomcat installation (note, when it is grayed out, read the section leading text! ;) ). This way Eclipse will take full control over Tomcat, this way you'll also be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse. I only don't see how that's useful while developing using Eclipse.
The port number is not the problem. You would otherwise have gotten an exception in Tomcat's startup log and the browser would show a browser-specific "Connection timed out" error page (and thus not a Tomcat-specific error page which would impossibly be served when Tomcat was not up and running!)
Upvotes: 117
Reputation: 26809
If you are new in JSP/Tomcat don't modify tomcat's xml files.
I assume you have already deployed web application. But to be sure, try these steps: - right click on your web application - select Run As / Run on Server, choose your Tomcat 7
These steps will deploy and run in the browser your application. Another idea to check if your Tomcat works correctly is to find path where tomcat exists (in eclipse plugin), and copy some working WAR file to webapps (not to wtpwebapps), and then try to run the app.
Upvotes: 5
Reputation: 127
Please check in your server specification again, if you have changed your port number to something else. And change the port number in your link whatever new port number it is.
Also check whether your server is running properly before you try accessing your localhost.
Upvotes: 5