gpt4 book ai didi

eclipse - Tomcat 工作正常,但我无法访问 http ://localhost:8080/

转载 作者:行者123 更新时间:2023-12-04 00:57:38 26 4
gpt4 key购买 nike

当我从 Windows 托盘运行 Tomcat 时,它启动了,但我无法访问 http://localhost:8080/ Tomcat 主页,但如果我从 Eclipse 运行它,它可以工作,我的应用程序可以工作,但我无法访问 http://localhost:8080/ ...

如何解决?还是正常的?

谢谢!

最佳答案

根据 this thread,这可能是正常的:

This is normal.
To see why, double-click on the Tomcat server in the Servers view. This will open the Tomcat configuration editor. Click on the "Open launch configuration" link in the Overview section. This will open the launch configuration properties dialog. Select the Arguments tab and examine the contents of the VM Arguments field.

Note that the catalina.home property points to your Tomcat installation, but catalina.base points to a ".metadata\.plugins\org.eclipse.wst.server.core\tmp" directory under your workspace.
Thus, you are running a separate instance of Tomcat. The "webapps" directory under the ".metadata\...\tmp" directory contains only an "empty" ROOT webapp plus any web projects you have added to the server. This is why you get the 404.

In the Tomcat configuration editor, you can uncheck the "Run modules directly from the workspace (do not modify the Tomcat installation)" option and catalina.base and catalina.home will both be set to your Tomcat installation.
Be aware that in this configuration, the Tomcat server in Eclipse "owns" your Tomcat installation.
Every time you start the Tomcat server from Eclipse, the Tomcat files under the Servers project in your workspace will overwrite the files in your installation.

It was assumed the most would want to keep their Tomcat installation independent from Eclipse Tomcat server, so the default is to create a separate Tomcat instance.
With separate instances, you can run the Tomcat installation at the same time as the Eclipse Tomcat server provided you modify one or both of them so that the ports they use do not conflict.

If you would like the standard Tomcat webapps present while keeping the separate Tomcat instance in Eclipse, switch to the Modules tab in the Tomcat configuration editor and use the "Add External Web Module" button to manually add the desired webapps. Note that this will add a little bit to the startup time for the server.



请注意,这是针对使用 WTP x1.5(似乎是 tomcat 5 或更低版本)的 tomcat 版本,在使用 WTP(Web 工具平台)x2.0 及更高版本的 tomcat 中,您不再获得该选项。相反,您需要进入服务器属性并点击开关位置,然后将显示正确的路径。然后进入服务器配置(双击服务器打开配置)并将“服务器位置”更改为“使用Tomcat灌输”(中间的)。 2

关于eclipse - Tomcat 工作正常,但我无法访问 http ://localhost:8080/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2848194/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com