Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat home page is not showing when running in Eclipse

I'm running Tomcat in Eclipse. I would like to see the Tomcat home page, however it doesn't show up. When I browse http://localhost:8080, then I get a HTTP 404 Page Not Found error.

How is this caused and how can I solve it?

like image 306
user1835080 Avatar asked Dec 25 '12 13:12

user1835080


2 Answers

Eclipse does by default not use Tomcat standalone. Instead, it overtakes its sole server engine and uses the workspace as deployment space instead of Tomcat's own /webapps folder. It also creates copies of configuration files like server.xml in the Servers project. It untouches the Tomcat installation. It untouches the Tomcat default homepage (and manager). It untouches existing deployments.

As the Tomcat homepage is not one of Eclipse projects (nor would become one), you won't see it when starting Tomcat from inside Eclipse like that. You would only see Eclipse projects which are deployed to the server by Add/Remove projects. I'm not sure why you need to see the Tomcat homepage as it has no utter value while developing Java EE web projects. But if you are really dead set on seeing it for some unclear reason, then you'd need to tell Eclipse to not only overtake its engine, but instead use the standalone installation at its entirety.

To configure that, double click Tomcat's entry in Servers view to open its configuration and in the Server Locations section, choose the option Use Tomcat installation.

enter image description here

You'll now be able to see Tomcat's homepage.

Again, the benefit is highly questionable. Do note that this way Eclipse will modify the Tomcat installation. So the Tomcat installation may not be reuseable across other IDEs/workspaces. You'd need to create a whole new Tomcat installation.

like image 106
BalusC Avatar answered Oct 17 '22 00:10

BalusC


In eclipse,right click over tomcat server in servier view. tomcate->properties.click switch location.

like image 23
dilipjoshi Avatar answered Oct 17 '22 02:10

dilipjoshi