Java Eclipse 无法加载或找到模块“xxx.war”的部署描述符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18906922/
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
Eclipse The deployment descriptor of the module 'xxx.war' cannot be loaded or found
提问by HymanDev
There's been a number of similar questions raised on this error on Eclipse:
在 Eclipse 上出现了许多关于此错误的类似问题:
The deployment descriptor of the module 'xxx.war' cannot be loaded or found.
无法加载或找到模块“xxx.war”的部署描述符。
This is a very generic error, and after scouring the web I have multiple different causes and solutions. I'm going to attempt to list them all here, so others won't have to go through the same thing I did.
这是一个非常普遍的错误,在网上搜索后,我有多种不同的原因和解决方案。我将尝试在此处列出所有内容,以便其他人不必经历与我所做的相同的事情。
If anyone experienced other causes and solutions, please list them here too. =)
如果有人遇到其他原因和解决方案,也请在此处列出。=)
(Moderators, please wait for me to put the answer up before judging this question)
(版主请等我把答案贴出来再判断这个问题)
采纳答案by HymanDev
Cause: Moved folders around
原因:移动文件夹
Solution: "Right click your dynamic web project -> Properties -> Deployment Assembly. In Web Deployment Assembly, change the package structure to reflect your change. That should work." (Eclipse deployment descriptor not found)
解决方案:“右键单击您的动态 Web 项目 -> 属性 -> 部署程序集。在 Web 部署程序集中,更改包结构以反映您的更改。应该可以。” (未找到 Eclipse 部署描述符)
Cause: Upgraded RAD/Eclipse
原因:升级的 RAD/Eclipse
Solution A: Add and remove the module in question in application.xml (http://www-01.ibm.com/support/docview.wss?uid=swg21297984)
解决方案 A:在 application.xml ( http://www-01.ibm.com/support/docview.wss?uid=swg21297984) 中添加和删除有问题的模块
Solution B: Go into the file explorer and edit .settings/org.eclipse.wst.common.component file and make sure the dependent module is listed (https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014042762)
解决方案 B:进入文件资源管理器并编辑 .settings/org.eclipse.wst.common.component 文件并确保列出了依赖模块(https://www.ibm.com/developerworks/community/forums/html/主题?id=77777777-0000-0000-0000-000014042762)
Cause: The dependent project has errors
原因:依赖项目有错误
Solution: If the dependent project has errors, it will not be built into a WAR, hence can not be referenced.
解决方案:如果依赖项目有错误,则不会构建到WAR中,因此无法引用。
Cause: Missing web.xml
原因:缺少 web.xml
Solution: This is a tricky one. A project with out web.xml won't show any errors (at least for me). But with out WEB-INF/web.xml file, it can't be regarded as a proper war file (http://en.wikipedia.org/wiki/WAR_file_format_(Sun)). Adding web.xml solved the issue.
解决方案:这是一个棘手的问题。没有 web.xml 的项目不会显示任何错误(至少对我而言)。但是没有 WEB-INF/web.xml 文件,它不能被视为一个正确的战争文件(http://en.wikipedia.org/wiki/WAR_file_format_(Sun))。添加 web.xml 解决了这个问题。
Cause: Wrong structure
原因:错误的结构
Solution: make sure the war file is included in the ear file. (https://community.jboss.org/thread/162761?start=0&tstart=0&_sscc=t)
解决方法:确保war文件包含在ear文件中。( https://community.jboss.org/thread/162761?start=0&tstart=0&_sscc=t)
Cause: In correct facets
原因:在正确的方面
Solution: "You must have these facets:
解决方案:“您必须具备以下方面:
- Dynamic Web Module
- Java
- Websphere Web (Con-existence)
- Websphere Web (Extended)
- 动态网页模块
- 爪哇
- Websphere Web(共存)
- Websphere Web(扩展)
In addition, in your Build Path -> Libraries you should have these entries:
此外,在您的构建路径 -> 库中,您应该有以下条目:
- EAR Libraries
- JRE System Library [IBM JDK]
- Web App Libraries
- Websphere Application Server [your-ver]" (http://stubbisms.wordpress.com/2007/11/26/deployment-descriptor-of-the-module-yourappplicationwar-cannot-be-loaded/)
- 耳朵图书馆
- JRE 系统库 [IBM JDK]
- 网络应用程序库
- Websphere Application Server [your-ver]”(http://stubbisms.wordpress.com/2007/11/26/deployment-descriptor-of-the-module-yourappplicationwar-cannot-be-loaded/)
Cause: Generic Eclipse Problem
原因:通用 Eclipse 问题
Solution: From time to time eclipse just stuffs up for various irrelevant reasons. To fix this, close the project, reopen, clean and recompile. Or even try it in a new work space if all else fails. (http://stubbisms.wordpress.com/2007/11/26/deployment-descriptor-of-the-module-yourappplicationwar-cannot-be-loaded/)
解决方案:有时 Eclipse 会因为各种不相关的原因而出现问题。要解决此问题,请关闭项目,重新打开,清理并重新编译。或者,如果所有其他方法都失败了,甚至可以在新的工作空间中尝试。(http://stubbisms.wordpress.com/2007/11/26/deployment-descriptor-of-the-module-yourappplicationwar-cannot-be-loaded/)
回答by BatBold
Had to delete the EAR from WS and disk but keep the related web projects and then checkout the EAR again. EAR deployment settings was corrupted. For anyone who has the similar situation.
不得不从 WS 和磁盘中删除 EAR,但保留相关的 Web 项目,然后再次检出 EAR。EAR 部署设置已损坏。对于任何有类似情况的人。
回答by umutdogan
For my case, I was generating "application.xml" using Maven POM and the solution for the issue was changing the maven-ear-plugin configuration like below:
就我而言,我使用 Maven POM 生成“application.xml”,问题的解决方案是更改 maven-ear-plugin 配置,如下所示:
....
<artifactId>maven-ear-plugin</artifactId>
<version>2.10.1</version>
<configuration>
<version>7</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<applicationName>MyCustom-ear</applicationName>
<fileNameMapping>no-version</fileNameMapping>
<modules>
....
After changing above, delete the project or module from Eclipse (but do not delete from disk). Go to project folder from file browser (e.g. Windows Explorer) and delete .settings and target folders and .project file from the project or module and reimport the project or the module to Eclipse and it should be working.
更改以上内容后,从 Eclipse 中删除项目或模块(但不要从磁盘中删除)。从文件浏览器(例如 Windows 资源管理器)转到项目文件夹并从项目或模块中删除 .settings 和目标文件夹以及 .project 文件,然后将项目或模块重新导入 Eclipse,它应该可以正常工作。