9

Eclipse keeps telling me there is a problem with http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd on my faces-config.xml, is anyone else having an issue with it?

 <?xml version="1.0" encoding="UTF-8"?>

 <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>

The error is:

  Referenced file contains errors (http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd).  

If I look at the details there are a ton of errors that start with s4s-elt-character:.....

I am using mojarra 2.1.13.

Thanks.

EDIT: Apparently Oracle changed it and this fixes it:

http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2_1.xsd

casolorz
  • 8,486
  • 19
  • 93
  • 200
  • 1
    If you experience similar problems with JSF 2.2 the same fix helps: http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2_2.xsd – electrodraco Aug 06 '13 at 22:15

5 Answers5

6

We are working on this right now. Identified the issue, working to resolve. Please track this JIRA issue: http://java.net/jira/browse/GLASSFISH-19115

Hope this helps and sorry for the 'bug'.

Update: This issue has been resolved.

John Clingan
  • 3,324
  • 21
  • 13
3

As SJuan76 points out, there's a problem with Oracle missing 2.1 faces-config XSD at http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd

Yet, 2.0 XSD is ok at http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd

The errors are probably due to incorrect response (it's not an XSD at all).

Workaround is using the same XSD from a different source (replace the second address in xsi:schemaLocation), for example: https://svn.java.net/svn/mojarra~svn/tags/2.1.13/jsf-api/doc/web-facesconfig_2_1.xsd

Warning: This is only a temporary workaround, not nice at all. Someone must first take a look at this at Oracle and put the 2.1 XSD back on java.sun.com address.

Jurri
  • 318
  • 2
  • 8
  • Well it doesn't seem to affect anything to have `http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd` failing except for Eclipse complaining. Hopefully Oracle will fix this. – casolorz Sep 23 '12 at 01:09
  • Apparently this fixed it `http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2_1.xsd` – casolorz Sep 25 '12 at 15:46
1

Put in your browser the URL:

 http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd

Oracle is returning a soft 404, and Eclipse (or anybody) can't parse that as xsd.

I bet there is a mistake with the URL, but I have not the right one in my head...

UPDATE: For 2.0 it is http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd (and the browse returns the .xsd); I find the URL you posted anywhere in the web but not in oracle... are you sure you have the 2.1 libraries in your classpath?

SJuan76
  • 24,532
  • 6
  • 47
  • 87
  • This is the url that eclipse put when I created the project `http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd` – casolorz Sep 23 '12 at 01:07
  • Fix `http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2_1.xsd` – casolorz Sep 25 '12 at 15:47
0

I have the same Error also,when I create a dynamic web project which has JSF 2.1 Configuration faces-config has this error, so i have to create web project with JSF 2.0 configuration.

0

I have the same trouble. To solve this I just create a new "Dynamic Project" and in project Facets (project/Properties/Project Facets) I marked the option "JavaServer Faces" version 2.1. After, you will see the message: "Further configuration required..." (below) click in this message and select the lib that contains your javax.faces-2.1.x.jar. Click in "OK" and "Apply". The eclipse create the faces-config.xml file that contains the correct description.

In my project generate this configurations:

<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>
Victor Jatobá
  • 811
  • 7
  • 13