XNSIO
  About   Slides   Home  

 
Managed Chaos
Naresh Jain's Random Thoughts on Software Development and Adventure Sports
     
`
 
RSS Feed
Recent Thoughts
Tags
Recent Comments

WebSphere Deployment Descriptor Load Exception

Getting the following error message while deploying an application in Websphere?

com.ibm.etools.j2ee.commonarchivecore.exception.
DeploymentDescriptorLoadException: IWAE0022E Exception occurred loading deployment descriptor

Context:
Check your web.xml.
If you are using the following XSD as the DOCTYPE of your web.xml http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
Then you might want to check your servlet tag to make sure they match the Servlet 2.4 specification.

For example, the following servlet causes the above exception when it tries to deploy the app.

1
2
3
4
5
6
7
8
9
10
<br />
&lt;servlet&gt;<br />
&lt;servlet-name&gt;sampleservlet&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;ABCClass&lt;/servlet-class&gt;<br />
&lt;init-param&gt;<br />
&lt;param-name&gt;ABCParamName&lt;/param-name&gt;<br />
&lt;param-value&gt;ABCParamValue&lt;/param-value&gt;<br />
&lt;description&gt;some desc&lt;/description&gt;<br />
&lt;/init-param&gt;<br />
&lt;/servlet&gt;<br />

Surprising this works perfectly fine if your web.xml is using http://java.sun.com/dtd/web-app_2_3.dtd as the DOCTYPE

Solution:
Removing the

1
2
<br />
&lt;description&gt;some desc&lt;/description&gt;<br />

tag from

1
2
<br />
&lt;init-param&gt;<br />

tag fixes the problem.

Another problem with DTDs:
If you are using DTD, the order of the tag elements within the web.xml must follow the order reflected in the DTD. Else you will get similar exception message. The order of the tags in web.xml is very important when using DTD. But it should not matter if you are using XSD.

If you open the DTD, it would list the order of the tags in there.
For example, web-app_2_3.dtd specifies the following order that the tags must have in order for the document to be considered a valid XML document:

1
2
<br />
&lt;!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)&gt;<br />

Hence

1
2
<br />
&lt;ejb-ref&gt;<br />

tag element must be before

1
2
<br />
&lt;ejb-local-ref&gt;<br />

tag.


    Licensed under
Creative Commons License