2017-07-07 1 views
0

Ceci est le début de mon web.xml dans lequel les erreurs se produisentquestion Web.xml ne peut pas trouver la déclaration

<?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 montre ces 2 erreurs:

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).

+0

Avez-vous après? – user7294900

+0

oui, il se termine par '' –

Répondre

0

Essayez d'utiliser:

<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"> 

+0

Maintenant, ce problème a disparu, mais un autre est apparu j'ai ce ' \t \t /proxyrest/* \t \t AuthenticationFilter \t ' cvc-complex-type.2.4.a: Un contenu invalide a été trouvé en commençant par l'élément 'url-pattern'. L'un des '{"http://java.sun.com/xml/ns/javaee":filter-name}' est attendu. –

+0

Voir https://stackoverflow.com/questions/6796692/eclipse-reporting-problem-in-my-web-xml-but-it-is-processed-fine – user7294900