I am building a web application in Eclipse and get a version issue in web.xml
:
<web-app version="2.4" xmlns="java.sun.com/xml/ns/javaee"
xmlns:xsi="w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="java.sun.com/xml/ns/javaee java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
The error is:
cvc-enumeration-valid: Value '2.4' is not facet-valid with respect to enumeration '[2.5]'.
It must be a value from the enumeration.
The project facet shows version 2.4 for both the Dynamic Web Module and the Servlet API.
If you declare your app in Eclipse to be a 2.5 app, and say that your web-app version is 2.4, but link to the schema of the 2.5 version (web-app_2_5.xsd
), it will obviously not work
<web-app version="2.4"
xmlns="java.sun.com/xml/ns/javaee"
xmlns:xsi="w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="java.sun.com/xml/ns/javaee
java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
^-- HERE!
Use the 2.4 version:
<web-app 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">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With