Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bogus Eclipse warning for web.xml: "No grammar constraints (DTD or XML schema) detected for the document."

The top of my web.xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?> <web-app 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_5.xsd"     version="2.5"> 

But I still get the warning from Eclipse (Ganymede) that no XML schema is detected, and schema violations are not being warned about. Other XML files in my project (Spring Framework configuration files for example) don't have the warning and do give correct warnings about schema violations.

How do I get the schema checking working and hopefully the warning to go away? The server does run correctly. It just appears to be an IDE issue.

like image 341
Brian Deacon Avatar asked Nov 26 '08 21:11

Brian Deacon


1 Answers

I hate that warning too. Specially because it appears in XML files that you haven't written but appear in your project for whatever reason (if you use MAVEN it's hell).

With Eclipse 3.5+ you can easily remove this validation rule. Go to Preferences-->XML-->XML FILES --> Validation and Select "ignore".

You may also have to do a Project -> Clean for the validation warnings to go away.

alt text

like image 114
monzonj Avatar answered Sep 30 '22 00:09

monzonj