Use web module version 2.4 or lower when migrating applications from WebSphere V6.1 or prior

This rule flags web modules with a version 2.5 or higher when they are being migrated from a WebSphere Application Server Version 6.1 or lower.

Support for web module version 2.5 was introduced in WebSphere Application Server Version 7. At that time the format for bindings and extensions changed from xmi to xml format. From Version 7 forward, the xmi formatted bindings will not be processed correctly in a web module that is version 2.5 or higher.

WebSphere Application Server V6.1 and prior allowed web modules to be installed that had a web.xml with a 2.5 version. The application would run without error if it did not try to use extra function provided by the higher specification level. This can result in a deployed application that cannot run properly in later versions of WebSphere.

For example, if you installed a web module with a version of 2.5 in WebSphere Application Server V6.1 and defined a virtual host at deploy time, the application would be successfully deployed. The virtual host definition would be saved in the application's binding xmi file, ibm-web-bnd.xmi. If you then migrate that web module to WebSphere Version 7.0 or higher, the server will expect binding information to be stored in an ibm-web-bnd.xml file rather than in the xmi format. The WebSphere Application Server remains backwards compatible, so if the web module has a version of 2.4, the ibm-web-bnd.xmi will be interpreted properly by WebSphere Version 7 or higher.

This mismatch of web module version and binding or extension file types can cause issues in the base server and the network deployment environments. Some of the possible error scenarios include:

When migrating from Version 6.1 and earlier, a web.xml with the following content will be flagged:

<web-app id="WebApp_Id" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
...
</web-app>

The web-app version should be modified to version 2.4. The automated fix will modify the version and the schema information as shown in the following example:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
...
</web-app>

For additional information on the Java EE specification levels supported on different WebSphere Application Server versions, see Programming model APIs and specifications.