Java – Eclipse reporting problem in the web.xml, but it is processed fine

eclipsegoogle-app-enginejavaservlets

I'm using Google App Engine with the Google plugin in Eclipse, here is the header of my web.xml:

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

Based on some of the GAE documentation, I added this:

<security-constraint>
    <web-resource-collection>
        <url-pattern>/tasks/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>admin</role-name>
    </auth-constraint>
</security-constraint>

However Eclipse reports an error at "url-pattern":

cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'.
One of '{"http://java.sun.com/xml/ns/javaee":web-resource-name}' is expected.

I can start the app and it seems to process the web.xml file just fine, but I don't like the fact that Eclipse is reporting an error. What is the problem?

Best Answer

well, the error seems pretty straightforward - a web-resource-name tag it expected before the url-pattern :)

cheers