Tomcat 不是从 Eclipse 开始的
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7025781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tomcat not starting from eclipse
提问by Matv
I'm trying to start tomcat server 6.0.32 (NOT MY APP) from eclipse but it fails with error "Server Apache Tomcat v6.0.32 at localhost failed to start". But when I'm starting it with startup.bat it is ok. I checked all ports for tomcat - they are free. Here it is a console log
我正在尝试从 Eclipse 启动 tomcat 服务器 6.0.32(不是我的应用程序),但它失败并显示错误“本地主机上的服务器 Apache Tomcat v6.0.32 无法启动”。但是当我用startup.bat 启动它时就可以了。我检查了 tomcat 的所有端口 - 它们是免费的。这是一个控制台日志
11.08.2011 15:15:46 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: <MY_PATH_VARIABLE>
11.08.2011 15:15:47 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
11.08.2011 15:15:47 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1068 ms
11.08.2011 15:15:47 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
11.08.2011 15:15:47 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
11.08.2011 15:15:47 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ProjectName.xml
Maybe someone know how to fix it?((((
也许有人知道如何解决它?((((
回答by Hyman
I had the same problem i.e. no errors in any of the logs, and the server started fine when launched from the command line using run.sh. However as soon as I used Eclipse (without or without my app) Tomcat wouldn't start at all.
我遇到了同样的问题,即任何日志中都没有错误,并且服务器在使用 run.sh 从命令行启动时正常启动。但是,一旦我使用了 Eclipse(无论有没有我的应用程序),Tomcat 就根本无法启动。
I solved this problem by performing the following steps:
我通过执行以下步骤解决了这个问题:
- In Eclipse, go to the 'Servers' tab.
- Double click the server.
- A configuration overview should be displayed in the main Eclipse panel.
- Under the sub-section 'Server Locations', select the radio button 'Use Tomcat Installation' (for me this was the middle radio button).
- Save the configuration (you should be prompted to do so anyway).
- Restart your server, and you should find localhost:8080 works from within the Eclipse browser.
- 在 Eclipse 中,转到“服务器”选项卡。
- 双击服务器。
- Eclipse 主面板中应显示配置概览。
- 在“服务器位置”小节下,选择单选按钮“使用 Tomcat 安装”(对我来说这是中间的单选按钮)。
- 保存配置(无论如何都应该提示您这样做)。
- 重新启动您的服务器,您应该会在 Eclipse 浏览器中发现 localhost:8080 有效。
回答by AndroidHustle
In Eclipse, go to:
在 Eclipse 中,转到:
Window -> Preferences -> Server -> Runtime Environments
窗口 -> 首选项 -> 服务器 -> 运行时环境
And add Apache Tomcat.
并添加 Apache Tomcat。
Hope this helps.
希望这可以帮助。
回答by Srikanth Venkatesh
The APR is the Apache Portable Runtime. This is a native (non-java) library that can improve the performance of Tomcat in certain situations.
APR 是 Apache Portable Runtime。这是一个原生(非java)库,可以在某些情况下提高Tomcat的性能。
回答by sandip patel
In my case it was not starting and stucked at
在我的情况下,它没有开始并停留在
INFO: Starting Servlet Engine: Apache Tomcat/8.5.32
信息:启动 Servlet 引擎:Apache Tomcat/8.5.32
Because the database connection configuration was wrong in context.xml
, the
ip:port were wrong, I changed it to currently working port and republish tomcat and its started working
因为数据库连接配置错误context.xml
,ip:port错误,我将其更改为当前工作端口并重新发布tomcat并开始工作
回答by Yannick
In my case, the problem came from an impossible loopback on localhost.
在我的情况下,问题来自本地主机上不可能的环回。
Tomcat effectively started (I could call "http://localhost:8080/myApp"), but Eclipse didn't get a response of that and it considered Tomcat keep on starting.
Tomcat 有效启动(我可以调用“ http://localhost:8080/myApp”),但 Eclipse 没有得到响应,它认为 Tomcat 继续启动。
A software called ZScaler (set by admin to protect the enterprise) on Windows 10 put loopback restrictions. Fortunately, an option existed to disable loopback restrictions on ZScaler.
Windows 10 上名为 ZScaler(由管理员设置以保护企业)的软件设置了环回限制。幸运的是,有一个选项可以禁用 ZScaler 上的环回限制。
A VPN may cause the same restrictions.
VPN 可能会导致相同的限制。
If you don't find which application cause th trouble, you can change "Host name" in Eclipse's Tomcat General Informations, from "localhost" to "yourIP" (ex : 179.25.14.178), BUT this trick won't allow DEBUG MODE.
如果你没有找到哪个应用程序导致了问题,你可以在 Eclipse 的 Tomcat General Informations 中将“Host name”从“localhost”更改为“yourIP”(例如:179.25.14.178),但是这个技巧不允许 DEBUG MODE .