Tomcat 未从 Eclipse 部署我的 Web 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12316540/
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 is not deploying my web project from Eclipse
提问by Betlista
I'm developing web application. Everything was working fine till yesterday.
我正在开发网络应用程序。一切正常,直到昨天。
Something happened yesterday (no idea what exactly) and Eclipse is not deploying my application any more.
昨天发生了一些事情(不知道究竟是什么),Eclipse 不再部署我的应用程序。
I'm using spring and maven, but it worked before, so I think there is no problem in this.
我用的是spring和maven,但是以前也用过,所以我觉得这个没有问题。
When I'm starting my application there is this in startup log:
当我启动我的应用程序时,启动日志中有这个:
7.9.2012 12:39:23 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: C:\Program Files\Java\jdk1.6.0_31\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre6/bin/client;C:/Program Files (x86)/Java/jre6/bin;C:/Program Files (x86)/Java/jre6/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\CVSNT\;c:\Programs\apache-ant-1.8.1\bin;C:\Program Files (x86)\Common Files\Teleca Shared;C:\SSD\Oracle11g\product.2.0\dbhome_3\bin;C:\SSD\Oracle11g\product.2.0\dbhome_1\bin;C:\Program Files (x86)\Groovy\Groovy-1.8.6\bin;C:\Programs\TortoiseSVN-1.7.7\bin;c:\Programs\apache-ant-1.8.1\bin;c:\Program Files\Java\jdk1.6.0_31\bin;c:\Programs\cygwin\bin;c:\Programs\apache-maven-2.2.1\bin;C:\SSD\Mudrc\Eclipse;;.
7.9.2012 12:39:23 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MudrcWeb2' did not find a matching property.
7.9.2012 12:39:23 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-9091"]
7.9.2012 12:39:23 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
7.9.2012 12:39:23 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 491 ms
7.9.2012 12:39:23 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
7.9.2012 12:39:23 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.29
7.9.2012 12:39:24 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-9091"]
7.9.2012 12:39:24 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
7.9.2012 12:39:24 org.apache.catalina.startup.Catalina start
INFO: Server startup in 693 ms
While I'm using spring, there should be at least context initialization in log.
当我使用 spring 时,日志中至少应该有上下文初始化。
I read several similar questions here
我在这里阅读了几个类似的问题
- Tomcat 7 in Eclipse Indigo: javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
- Tomcat started in Eclipse but unable to connect to http://localhost:8085/
- Eclipse : Starting tomcat server from eclipse , does not start the deployed wars
- Where does Eclipse deploy web applications using WTP?
- "SetPropertiesRule" warning message when starting Tomcat from Eclipse
- Setting property 'source' to 'org.eclipse.jst.jee.server:JSFTut' did not find a matching property
- Eclipse Indigo 中的 Tomcat 7:javax.naming.NameNotFoundException:找不到资源 /WEB-INF/classes
- Tomcat 在 Eclipse 中启动但无法连接到 http://localhost:8085/
- Eclipse:从 Eclipse 启动 tomcat 服务器,不启动已部署的War
- Eclipse 在哪里使用 WTP 部署 Web 应用程序?
- 从 Eclipse 启动 Tomcat 时出现“SetPropertiesRule”警告消息
- 将属性 'source' 设置为 'org.eclipse.jst.jee.server:JSFTut' 没有找到匹配的属性
but nothing helped
但没有任何帮助
I tried adding new server to Eclipse, renaming project, cleaning and still it is the same.
我尝试向 Eclipse 添加新服务器、重命名项目、清理,但它仍然是相同的。
When I build it with maven I can deploy it to Tomcat and it works.
当我用 maven 构建它时,我可以将它部署到 Tomcat 并且它可以工作。
采纳答案by swemon
Have you check your deploy pathin Server Locations? May be your tomcat deploy path changed and Eclipse is not deploying your application.
您是否在Server Locations 中检查了您的部署路径?可能是您的 tomcat 部署路径已更改并且 Eclipse 未部署您的应用程序。
In eclipse.
在日食。
- Window -> Show View -> Servers.
- Double click to your server.
In Tomcat Server's Overview.
3.1 check your Server Path
3.2 check your Deploy Path
- 窗口 -> 显示视图 -> 服务器。
- 双击您的服务器。
在 Tomcat 服务器的概述中。
3.1 检查你的服务器路径
3.2 检查您的部署路径
回答by robert lennon
SOLVED: I faced this error and i cant understand, it took 5 hours.
已解决:我遇到了这个错误,我无法理解,花了 5 个小时。
Solution: project properties/Project faced/Dynamic web-module version set to 3.0
解决方案:项目属性/项目面临/动态网络模块版本设置为3.0
after one week ,I got same error
一周后,我得到了同样的错误
FIXED2 gwt-project-external-mode-main-main-nocache-js-not-found
FIXED2 gwt-project-external-mode-main-main-nocache-js-not-found
回答by Anuj Sharma
I have faced this issue and I just removed the server from eclipse and re-configured it... And everything started working fine... I have faced it two three times and the same thing worked.
我遇到了这个问题,我刚刚从 eclipse 中删除了服务器并重新配置了它......一切都开始正常工作......我已经遇到过两次三遍,同样的事情也奏效了。
回答by JayabalanAaron
Same problem, not sure why it occurred only after upgrading from Spring
v3.2.x
to v4.2.x
.
同样的问题,不知道为什么它只是从升级后出现Spring
v3.2.x
到v4.2.x
。
Solved it by doing the following:
通过执行以下操作解决了它:
- Clear all eclipse files [.classpath, .project, .settings/].
- Perform >mvn eclipse:eclipse
- Perform eclipse>project>properties>deploymentassembly add [referenced projects, additional classpaths].
- 清除所有 eclipse 文件[.classpath, .project, .settings/]。
- 执行>mvn eclipse:eclipse
- 执行eclipse>project>properties>deploymentassembly add [referenced projects, additional classpaths]。
Publishand Startthe module in Tomcat
tab, it now starts properly.
在选项卡中发布并启动模块Tomcat
,它现在可以正常启动。
回答by Faxon
Drop server.......... Window -> Show View -> Servers. Click right - > Delete
删除服务器.......... 窗口 -> 显示视图 -> 服务器。单击右键-> 删除
Click right in the Project Run Configuration
在项目运行配置中单击右键
and add Server again......
并再次添加服务器......
回答by N..
I had the same problem. I fixed it by makinbg the following entry in org.eclipse.wst.common.project.facet.core.xml
我有同样的问题。我通过在 org.eclipse.wst.common.project.facet.core.xml 中创建以下条目来修复它
<runtime name="Apache Tomcat v7.0" />
Now this complete file looks like -
现在这个完整的文件看起来像 -
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v7.0" />
<fixed facet="wst.jsdt.web" />
<installed facet="java" version="1.5" />
<installed facet="jst.web" version="2.3" />
<installed facet="wst.jsdt.web" version="1.0" />
</faceted-project>
回答by mannedear
I have this similar problem where I'm able to start the tomcat server but however application not initialized or started, so I have Right clicked on my project --> Deployment Assembly --> Click 'Add' in the right side panel, select 'Java Build path entries' and click 'Next', Now select 'Maven dependencies' and click 'Finish'. Now I run the server and it started the application successfully.
我有这个类似的问题,我可以启动 tomcat 服务器,但是应用程序没有初始化或启动,所以我右键单击了我的项目 --> 部署程序集 --> 单击右侧面板中的“添加”,选择“Java 构建路径条目”并单击“下一步”,现在选择“Maven 依赖项”并单击“完成”。现在我运行服务器并成功启动了应用程序。
回答by AppleBuckler
Depsite the year old topic, this one seems to have the most of the answers for this problem. Just ren into it. Tried everything, starting from "cleans", ending with total ".metadata" and another server setup, and nothing worked.
除了这一年的话题,这个话题似乎对这个问题有最多的答案。就这样吧。尝试了一切,从“清理”开始,以总“.metadata”和另一个服务器设置结束,但没有任何效果。
Than i remembered that a while ago i'w decided to clean up some of the "pom" warnings, and there were some suggestions on "apply to the project data". Then i started to browse the folder project, where i found the source of my headache - a file called ".tomcatplugin". After deleting it(it was the third hour of my attempts of resolving the problem) everything worked like a charm.
我记得不久前我决定清理一些“pom”警告,并且有一些关于“应用于项目数据”的建议。然后我开始浏览文件夹项目,在那里我找到了我头疼的源头——一个名为“.tomcatplugin”的文件。删除它后(这是我尝试解决问题的第三个小时),一切都像魅力一样。
回答by Bakul Kakadiya
Got it :)
知道了 :)
Usually caused when eclipse is reffering to another (or in correct web folder, may be webConent)
通常在 eclipse 引用另一个时引起(或在正确的 web 文件夹中,可能是 webConent)
- Update .settings/.jsdtscope to have correct entry for webapp, similar to below
- 更新 .settings/.jsdtscope 以获得正确的 webapp 入口,类似于下面
- Update org.eclipse.wst.common.component to have correct entry for webapp
- 更新 org.eclipse.wst.common.component 以获得正确的 webapp 入口