Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web.xml validation error

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"
like image 602
michael nesterenko Avatar asked Mar 04 '11 17:03

michael nesterenko


People also ask

What is an XML validation error?

Typically, the system returns this error if there was a problem with authentication due to an error in the submitted Merchant Id, user, and/or password. The problem may also be due to the use of single quotes around the attribute (merchantId) value. Error validating xml data against the schema on line 1.

Does XML allow validation?

It is not possible for an XML parser to validate all aspects of a document's content; a parser cannot understand the complete semantics of the data.

What is XSD validation error?

The schema is defined by the XSD. Schema errors occur where there is a problem with the structure or order of the file, or an invalid character is included. Schema errors prevent the validation being run in full because the file cannot be read. This means that errors cannot be traced to a particular record.


1 Answers

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>
like image 109
BalusC Avatar answered Sep 27 '22 20:09

BalusC