Multiple annotations found web XML

If you are getting below exception while configuring your application with latest facet:

Multiple annotations found at this line:

Multiple annotations found at this line:
	- cvc-enumeration-valid: Value '2.5' is not facet-valid with respect to enumeration '[3.0]'. It must be a value from the 
	 enumeration.
	- Start tag of element <web-app>
	- cvc-attribute.3: The value '2.5' of attribute 'version' on element 'web-app' is not valid with respect to its type, 'web-app-
	 versionType'.

Solution: This happens if your IDE or your environment doesn’t support latest version of project facet which your are trying to use. As you see below project facet set to module 3.0 and web.xml file uses 2.5 version:

Multiple annotations found web XML

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

To fix this: Please keep both in sync as below:

Multiple annotations found web XML

web.xml:

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

Note: If you are not able to change Project Facet from eclipse GUI then go to Navigator view and see below where to change version value:

Multiple annotations found web XML

 

Leave a Reply

Your email address will not be published. Required fields are marked *