Eclipse 中的 Tomcat 6 配置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15100471/
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 6 configuration inside Eclipse
提问by amphibient
I am having trouble configuring my Eclipse EE
to run Tomcat 6 (my company has not migrated to Tomcat 7 yet). I was trying to follow these instructions. I went into the servers tab in the bottom panel, hit New->Server
, then chose Apache->Tomcat 6
. Then I went through a succession of the following screens:
我在配置我Eclipse EE
以运行 Tomcat 6时遇到问题(我的公司尚未迁移到 Tomcat 7)。我试图按照这些说明进行操作。我进入底部面板中的服务器选项卡,点击New->Server
,然后选择Apache->Tomcat 6
。然后我经历了以下一系列屏幕:
and finally arrived to the error message:
终于到了错误信息:
Here are the contents of my Tomcat conf dir (C:\home\SFTWR\tomcat6\conf
):
以下是我的 Tomcat conf 目录 ( C:\home\SFTWR\tomcat6\conf
) 的内容:
catalina.policy
catalina.properties
context.xml
logging.properties
server.xml
web.xml
wrapper.properties
Any suggestion what may be wrong? It runs fine when running standalone and I can deploy apps from Eclipse but I would like to be able to run in in Eclipse for debugging purposes.
任何建议可能有什么问题?它在独立运行时运行良好,我可以从 Eclipse 部署应用程序,但我希望能够在 Eclipse 中运行以进行调试。
UPDATE:
更新:
Despite the error message, I noticed that the server was indeed registered, however, not functional -- when I tried to hit "Start", I got an error popup listing two problems:
尽管有错误消息,但我注意到服务器确实已注册,但无法正常工作——当我尝试点击“开始”时,我收到一个错误弹出窗口,列出了两个问题:
Publishing to localhost(Details: Cannot publish to the server because it is missing its runtime environment.)
Starting localhost(Details: An internal error occurred during: "Starting localhost". java.lang.NullPointerException)
发布到本地主机(详细信息:无法发布到服务器,因为它缺少运行时环境。)
启动本地主机(详细信息: 在“启动本地主机”期间发生内部错误。java.lang.NullPointerException)
The detailed exception stack trace is as follows:
详细的异常堆栈跟踪如下:
org.eclipse.core.runtime.CoreException: Could not load the Tomcat server configuration at \Servers\localhost-config. The configuration may be corrupt or incomplete.
at org.eclipse.jst.server.tomcat.core.internal.Tomcat60Configuration.load(Tomcat60Configuration.java:313)
at org.eclipse.jst.server.tomcat.core.internal.TomcatServer.getTomcatConfiguration(TomcatServer.java:124)
at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.getTomcatConfiguration(TomcatServerBehaviour.java:80)
at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.setupLaunch(TomcatServerBehaviour.java:496)
at org.eclipse.jst.server.tomcat.core.internal.TomcatLaunchConfigurationDelegate.launch(TomcatLaunchConfigurationDelegate.java:96)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:696)
at org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3402)
at org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3340)
at org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:363)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
回答by user2184752
I seem to have had the same problem with Eclipse Juno and Tomcat 6.0_36 on Centos 6.3. It took me 2 days to realize that the problem only existed when the Tomcat server was started before Eclipse was started (e.g. at boot time).
我似乎在 Centos 6.3 上的 Eclipse Juno 和 Tomcat 6.0_36 上遇到了同样的问题。我花了 2 天的时间才意识到问题仅在 Eclipse 启动之前启动 Tomcat 服务器时才存在(例如在启动时)。
Executing "/etc/init.d/tomcat stop" before starting Eclipse solved my problem.
在启动 Eclipse 之前执行“/etc/init.d/tomcat stop”解决了我的问题。