Check for a behavior change regarding duplicate elements in web descriptors

The Servlet 3.1 specification clarifies that a web.xml file cannot contain more than one <absolute-ordering> element. Additionally, web-fragment.xml files cannot contain more than one <ordering> element. Applications with multiple <ordering> or <absolute-ordering> elements will fail to deploy. In Servlet 3.0, the deployment of the application does not fail, but the function of the elements might be indeterminate.

This rule flags duplicate <absolute-ordering> elements in the web.xml files and duplicate <ordering> elements in the web-fragment.xml files.

To resolve this issue, remove the duplicate elements and merge their content as needed into a single element.

For more information on Servlet 3.1 behavior changes, see the following resource: Servlet 3.1 behavior changes.