简体   繁体   中英

Eclipse The deployment descriptor of the module 'xxx.war' cannot be loaded or found

There's been a number of similar questions raised on this error on Eclipse:

The deployment descriptor of the module 'xxx.war' cannot be loaded or found.

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)

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 )

Cause: Upgraded RAD/Eclipse

Solution A: Add and remove the module in question in 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 )

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.

Cause: Missing 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.

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 )

Cause: In correct facets

Solution: "You must have these facets:

  • Dynamic Web Module
  • Java
  • Websphere Web (Con-existence)
  • Websphere Web (Extended)

In addition, in your Build Path -> Libraries you should have these entries:

Cause: Generic Eclipse Problem

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/ )

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.

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:

....
<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 (eg 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.

I had a freshly cloned project from git, I created a EarContent folder inside my EAR project. And I was able to add my project(EAR resource) to the Liberty server.
Manually adding EarContent folder which is a blank folder solver my issue.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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