8

I have got one more error in web xml

-Cannot resolve the name 'javaee:web-appType' to a(n) 'type definition' component.

and web.xml file

<?xml version="1.0" encoding="UTF-8"?><!--error here-->
<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_3_0.xsd"
skaffman
  • 398,947
  • 96
  • 818
  • 769
michael nesterenko
  • 14,222
  • 25
  • 114
  • 182

1 Answers1

9

You forgot the xmlns:web namespace. Here's the complete Servlet 3.0 compatible declaration.

<?xml version="1.0" encoding="UTF-8"?>
<web-app
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    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_3_0.xsd"
    id="Your_Webapp_ID" version="3.0">

    <!-- Config here -->

</web-app>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 1
    Isn't XML-Standard for xmlns-Attributes to use URIs rather than URLs? Concrete: xmlns:web="http://java.sun.com/xml/ns/javaee". If no reason comes up here, I will edit the answer in 4 weeks or so. – Tires Dec 23 '12 at 11:29