Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 581
JackDev Avatar asked Sep 20 '13 00:09

JackDev


People also ask

Why deployment descriptor is not showing in eclipse?

Right click your dynamic web project -> Properties -> Deployment Assembly. In Web Deployment Assembly , change the package structure to reflect your change. That should work.

How do I get web XML in Eclipse?

To get access to web. xml in Eclipse, even though it's in the webapps\ch11\WEB-INF directory, you can make it a linked file . To do that, right-click the ServletInPlace project, select New→ File, click the Advanced button, check the “Link to file in the file system” checkbox, and click the Browse button.

Where is deployment assembly in Eclipse?

To use the Deployment Assembly page, right-click your Java EE project and select Properties > Deployment Assembly. For Java EE modules the page consists of two tabs: The Deployment Assembly tab, which consists of a table that contains a Deploy Path column and a Source column.

What is deployment descriptor in Java?

Java web applications use a deployment descriptor file to determine how URLs map to servlets, which URLs require authentication, and other information. This file is named web. xml , and resides in the app's WAR under the WEB-INF/ directory.


2 Answers

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:

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

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

like image 70
JackDev Avatar answered Sep 21 '22 03:09

JackDev


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.

like image 37
BatBold Avatar answered Sep 20 '22 03:09

BatBold