Tomcat home page is not showing when running in Eclipse

泪湿孤枕 提交于 2020-01-10 14:35:55

问题


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?


回答1:


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.

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.




回答2:


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




回答3:


Try the following steps once:

1.Remove schoolManagementsystem folder and war file from webapps folder

2.Task Manager--> end the all java process

3.Now execute the command catalina.bat run in command prompt.

Hope this will help you .



来源:https://stackoverflow.com/questions/14030857/tomcat-home-page-is-not-showing-when-running-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!