Monday, July 17, 2006

Can't deploy WAR on WebSphere 6 - AppDeploymentException

websphere war deploy install "The EAR file might be corrupt or incomplete" DeploymentDescriptorLoadException

Trying to deploy ("install") a war file (for the Jakarta Slide WebDAV Server) in WebSphere after it appeared to work fine on Tomcat & JBoss gets the following two messages in the WebSphere Administration Console:

  1. The EAR file might be corrupt or incomplete.

  2. AppDeploymentException: [null] IWAE0022E Exception occurred loading deployment descriptor for module "[warfilename].war" in EAR file "[WebSphereHome]\profiles\[ProfileName]\wstemp\[TempFolder]\upload\[warfilename]_war.ear"

The first message (and the .ear part of the second) is very confusing and from a quick google it seems that many developers are thrown off and attempt to put their war file in an ear ... it's not necessary.

The clue was the cause exception "DeploymentDescriptorLoadException" in the second message. It's a long story how I got to this, but the issue was my deployment descriptor - WEB-INF\web.xml. WebSphere validates this against the schema for the web.xml and is not flexible. Add this detail to you opening <web-app> node in your web.xml and make sure it is valid according to the schema (using an editor such as XML Spy):
<web-app version="2.4" 

In my situation slide contained a security-constraint which in turn referenced http-method names that aren't valid according to the web.xml spec (limited to HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE). But WebDAV extends the HTTP spec ... not sure what to do about that. Commenting out the entire security-constraint section or the offending http-method references fixes the issue for the mean time.

Next issue is how to configure some basic users and roles in WebSphere. The documentation seems very thorough on overviews and definitions, but light-on when it comes to how-tos.


Alex said...

Another reason for this exception could be that the taglib tag is not wrapped around the <jsp-config> tag.
So a valid web.xml 2.4 with taglib declaration would be:


Alex said...

For version 2.3 of web-app it appears to be sufficient to simply add <web-app id="WebAppId">

Anonymous said...

Excellent, it worked. I validated the XML in Internet Explorer at (Note: It only works in IE)

Venkata Madugundu

Anonymous said...

Thank you SososoSo much!!!