简体   繁体   English

从eclipse启动时看不到Tomcat主页(http:// localhost:8080)。 但是,当我从tomcat bin目录启动它时会加载它。 有什么想法吗?

[英]Cannot see Tomcat homepage( http://localhost:8080) when starting it from eclipse. But it loads when I start it from tomcat bin directory. Any idead?

  • I have added tomcat 7 to my eclipse. 我已经将tomcat 7添加到了我的日食中。
  • When I start the server it gets started successfully(shows the message in console) but when I hit the URL http://localhost:8080 it says "404 resource not found". 当我启动服务器时,它成功启动(在控制台中显示该消息),但是当我单击URL http:// localhost:8080时,它显示“找不到404资源”。
  • Strange thing is when I go to Tomcat bin directory and start it through start.bat, the same url http://localhost:8080 shows the tomcat homepage in browser without any issue. 奇怪的是,当我进入Tomcat bin目录并通过start.bat启动它时,相同的URL http:// localhost:8080在浏览器中显示了tomcat主页,没有任何问题。 Any idea? 任何想法? Help is appreciated. 感谢帮助。

You need to be aware of two directory trees with Tomcat : TOMCAT_HOME and TOMCAT_BASE . 您需要了解Tomcat的两个目录树: TOMCAT_HOMETOMCAT_BASE

TOMCAT_HOME contains binary related data and can be shared by many running Tomcat instances (it contains jar, dll, exe and other non-contextual data). TOMCAT_HOME包含与二进制相关的数据,并且可以由许多正在运行的Tomcat实例共享(它包含jar,dll,exe和其他非上下文数据)。

TOMCAT_BASE specifies configuration files (ie catalina.properties , server.xml , context configurations), webapp directories and further files such as specific librairies if required. TOMCAT_BASE指定配置文件(即catalina.propertiesserver.xml ,上下文配置),webapp目录以及其他文件(例如需要时的特定库)。

When running Tomcat from his installation directory: TOMCAT_HOME and TOMCAT_BASE are set to same location. 从安装目录运行Tomcat时: TOMCAT_HOMETOMCAT_BASE设置在同一位置。 Then, Tomcat serves ${TOMCAT_HOME}\\webapps directory. 然后,Tomcat提供${TOMCAT_HOME}\\webapps目录。 The special ROOT context let serve the root path and by default contains a simple webapp (browse ${TOMCAT_HOME}\\webapps\\ROOT for more information). 特殊的ROOT上下文允许提供根路径,并且默认情况下包含一个简单的webapp(有关更多信息,请浏览${TOMCAT_HOME}\\webapps\\ROOT )。

When running Tomcat from Eclipse, Eclipse will setup two directories: 从Eclipse运行Tomcat时,Eclipse将设置两个目录:

  1. with editable configuration (generally goes under ${WORKSPACE}\\Servers\\${SERVER_NAME}-conf ) 具有可编辑的配置(通常位于${WORKSPACE}\\Servers\\${SERVER_NAME}-conf
  2. with deployed files from last describe directory, served context configuration, deployed context and some other working files such as log and work directories. 最后描述目录中的已部署文件,服务的上下文配置,已部署的上下文以及一些其他工作文件(例如日志和工作目录)。

This last directory generally goes under your workspace metadata but you can edit it from the server editor. 最后一个目录通常位于工作空间元数据下,但是您可以从服务器编辑器中对其进行编辑。 And Eclipse uses this directory as TOMCAT_BASE . Eclipse将此目录用作TOMCAT_BASE To this directory, Eclipse doesn't deploy the default ROOT webapp neither other default ones ( docs , examples , host-manager and manager ). 在该目录中,Eclipse不会部署默认的ROOT Webapp,也不会部署其他默认的ROOT Webapp( docsexampleshost-managermanager )。 If necessary you can add them from the server configuration directory (first one described). 如有必要,您可以从服务器配置目录(描述的第一个)中添加它们。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tomcat在Eclipse运行时打不开http://localhost:8080/ - Cannot open http://localhost:8080/ when Tomcat is running in Eclipse 从Mac上的IntelliJ Ultimate Edition启动Tomcat 8.0.27时看不到Tomcat主页 - Not able to see Tomcat homepage when starting Tomcat 8.0.27 from IntelliJ Ultimate Edition on Mac 当我通过tomcat启动我的应用程序时,为什么仍然得到“ http:// localhost:8080”? - Why I still get “http://localhost:8080” when I start my app by tomcat? 我已经安装了Apache Tomcat 7,并且在浏览器中转到http:// localhost:8080时,看到以下错误:HTTP状态500 - I have installed Apache Tomcat 7 and when I goto http://localhost:8080 in my browser, I see the following error : HTTP Status 500 从Eclipse启动Tomcat时超时 - Timeout when starting Tomcat from Eclipse Tomcat不在启动时从eclipse启动:本地主机上的Tomcat服务器所需的多个端口(8005、8080)已在使用中 - Tomcat doesn't start from eclipse on startup : Several ports (8005, 8080) required by Tomcat Server at localhost are already in use 我该如何访问 <tomcat> 从Eclipse内部运行时的\\ bin \\ *。属性? - How can I access <tomcat>\bin\*.properties when running from inside eclipse? 使用eclipse远程调试(NOT localhost)tomcat。 远程机器拒绝连接 - Remote debugging(NOT localhost) tomcat using eclipse. Connection refused from remote machine 从Eclipse内部启动Tomcat Mongrel插件时发生致命错误 - Fatal error when starting Tomcat mongrel plugin from inside eclipse Tomcat 启动但主页无法打开,网址为 http://localhost:8080 - Tomcat starts but home page cannot open with url http://localhost:8080
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM