2

I created a JSF 2.1 project in Eclipse. While building the project, it shows the following error markers:

  • cvc-elt.1: Cannot find the declaration of element 'faces-config'.
  • schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd', because
    1. could not find the document;
    2. the document could not be read;
    3. the root element of the document is not <xsd:schema>.

How is this caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
KIRAN
  • 21
  • 1
  • 4

2 Answers2

4

Your own solution seems to bee very specific. The default tag should look like this

<faces-config 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-facesconfig_2_1.xsd"
          version="2.1">
    ....
</faces-config>
drkunibar
  • 1,327
  • 1
  • 7
  • 7
0

Found the answer, it seems there is no xsd file in the given URL.

So changed the url to https://svn.java.net/svn/mojarra~svn/tags/2.1.13/jsf-api/doc/web-facesconfig_2_1.xsd.

It is working fine.

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
KIRAN
  • 21
  • 1
  • 4