0

This is the start of my web.xml in which the errors occur

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

Eclipse shows these 2 errors :

Error 1 : cvc-elt.1: Cannot find the declaration of element 'web-app'. web.xml /"app.module"/src/main/webapp/WEB-INF line 5 XML Problem

Error 2 : Referenced file contains errors (jar:file:/C:/Program Files/eclipse/plugins/org.jboss.tools.as.catalog_3.2.4.v20170308-1740.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).

2
  • Do have </web-app> after it? Commented Jul 7, 2017 at 10:02
  • yes it ends with </web-app> Commented Jul 7, 2017 at 10:06

1 Answer 1

1

Try using:

 <web-app 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"
      version="2.5">

Sign up to request clarification or add additional context in comments.

2 Comments

Now this issue is gone but another appeared i have this <filter-mapping> <url-pattern>/proxyrest/*</url-pattern> <filter-name>AuthenticationFilter</filter-name> </filter-mapping> cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'. One of '{"java.sun.com/xml/ns/javaee":filter-name}' is expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.