简体   繁体   English

Tomcat在Eclipse中发布

[英]Tomcat issues inside eclipse

I am very new to Tomcat and web development in general and apologize for what may be a very silly question. 我对Tomcat和web开发很新,并为可能是一个非常愚蠢的问题道歉。

Consider 2 situations: 考虑两种情况:

1. 1。

I start Tomcat outside of Eclipse. 我在Eclipse之外启动Tomcat。
I use eclipse to create a war file. 我用eclipse来创建一个war文件。
I deploy it via admin console. 我通过管理控制台部署它。
All is ok 一切都好

2. 2。

I start Tomcat via Eclipse 我通过Eclipse启动Tomcat
I can't access admin console 我无法访问管理控制台

http://localhost:8080/manager/html greets me with 404 error http:// localhost:8080 / manager / html因404错误问候我
Same page is behaving properly when Tomcat is started outside of Eclipse 当Tomcat在Eclipse之外启动时,相同页面的行为正常

Please advise 请指教

Why might the issue be? 问题为什么会这样?

Why might the issue be? 问题为什么会这样?

You need to configure Eclipse to take control of your Tomcat installation . 您需要配置Eclipse以控制Tomcat安装 To do so: 为此:

  • double click on the Tomcat Server in the Servers view 双击Servers视图中的Tomcat服务器
  • under Server Locations , select Use Tomcat installation 在“ 服务器位置”下 ,选择“ 使用Tomcat安装”

This is illustrated on the screenshot below: 这在下面的屏幕截图中说明:

替代文字

Eclipse creates a new Tomcat configuration separate to your Tomcat installation, in the 'Servers' project. Eclipse在“Servers”项目中创建了一个与Tomcat安装分开的新Tomcat配置。 This allows Eclipse to deploy webapps without interfering with anything you've done in your installation (via the manager app or by editing config files manually). 这允许Eclipse部署Web应用程序而不会干扰您在安装中完成的任何操作(通过管理器应用程序或手动编辑配置文件)。

You can reconfigure Eclipse so that it uses the config from your Tomcat installation (see Pascal's answer), or to re-enable the manager app - but read the WTP Tomcat FAQ first as there are good reasons for it working the way it does. 可以重新配置Eclipse以便它使用Tomcat安装中的配置(请参阅Pascal的答案),或者重新启用管理器应用程序 - 但首先要阅读WTP Tomcat常见问题解答,因为它有充分的理由让它按照它的方式工作。 I don't recall ever needing to do this - the 'Servers' tab in Eclipse lets you deploy/start/stop/debug/configure apps as required. 我不记得曾经需要这样做 - Eclipse中的“Servers”选项卡允许您根据需要部署/启动/停止/调试/配置应用程序。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM