12

I make in JSF Project in eclipse and The file faces-config.xml give an error

Referenced file contains errors (jar:file:/D:/eclips/eclipse k/plugins/org.jboss.tools.jst.web_3.5.0.Final-v20130717-0309-B75.jar!/catalog/web-facesconfig_2_2.xsd). 

faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">

</faces-config>

when I remove the following line, error indication vanish in faces-config.xml

http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd

Update me how to resolve this issue ?

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
Shahid Ghafoor
  • 3,049
  • 14
  • 58
  • 108
  • Is your jars JSF version 2.2. ? – erencan Sep 17 '13 at 06:41
  • @erencan yes! version="2.2" showing above in faces-config.xml – Shahid Ghafoor Sep 17 '13 at 07:05
  • i am asking for jar versions. – erencan Sep 17 '13 at 07:09
  • @erencan yes! `JSF 2.2 (Mojarra 2.2.0)\mojarra-2.2.0-FCS\lib\javax.faces.jar` – Shahid Ghafoor Sep 17 '13 at 07:14
  • Try the current development release of JBoss Tools: http://download.jboss.org/jbosstools/updates/development/kepler/ – BalusC Sep 17 '13 at 11:03
  • I am using Kepler @BalusC – Shahid Ghafoor Sep 17 '13 at 11:25
  • I know. Have you tried the current development release of JBoss Tools as asked in previous comment? – BalusC Sep 17 '13 at 12:41
  • Base on your recommendation I refer your previous comment but `Referenced file contains errors (jar:file:/D:/eclips/eclipse k/plugins/org.jboss.tools.jst.web_3.5.1.Alpha1-v20130906-1546-B80.jar!/catalog/web-facesconfig_2_2.xsd)` again error ! :( @BalusC – Shahid Ghafoor Sep 17 '13 at 12:44
  • Well, report it to JBoss Tools guys: https://issues.jboss.org/browse/JBIDE In the meanwhile, just ignore the error. The code should work and run just fine. – BalusC Sep 17 '13 at 14:53
  • OK! To remove error I put semi colon (;) between two location (xsi:schemaLocation) such as `xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee; http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"` now there is no any error ! @BalusC – Shahid Ghafoor Sep 18 '13 at 01:33

5 Answers5

11

You specified http://xmlns.jcp.org/xml/ns/javaee twice, so remove one.

Alexander Vogt
  • 17,075
  • 13
  • 45
  • 61
Shukti
  • 137
  • 2
  • The faces-config.xml of JSF 2.2 is created with a duplicated namespace. So the above answer is actually correct. Remove the first occurrence of 'http://xmlns.jcp.org/xml/ns/javaee' and the problem should be solved. – ThiagoPonte Oct 04 '13 at 02:54
5

Disabling caching of XSD files fixed the issues for me - with Eclipse Neon, the relevant option is at Window->Preferences->General->Network Connections->Cache->Disable Caching. Check that box, then clean and build. I think in my case what happened is I tried to rebuild while on a wifi with no internet connection, Eclipse tried to validate those files and couldn't, and decided to show this type of error.

Matt McMinn
  • 14,905
  • 14
  • 54
  • 68
2

For me, removing the duplicate namespace had an unpleasant side effect of disabling content assist when editing faces-config.xml.

These headers with "duplicate" namespaces are specified everywhere like that, the faces-config one in particular is mentioned in the JSF specification. Even the W3C XML Schema specification features a similar example.

So it seems that the header in question is correct. Installing the latest updates for Eclipse and JBoss tools solved this problem for me.

It may be related to these JBoss Tools issues: JBIDE-14439, JBIDE-15605.

Vsevolod Golovanov
  • 3,355
  • 3
  • 25
  • 59
1

You have two options(i only found these.. haha):

1 - You specified http://xmlns.jcp.org/xml/ns/javaee twice, so remove one.(by Shukti)

2- If you're getting some erros like "cvc-complex-type..." just put <from-view-id>something here </from-view-id> in navigation-rules for each line with error. (the error will disapear, but, i can't ensure it will work for you).

renatohlf
  • 381
  • 3
  • 11
0

I faced same issue in weblogic.xml file, so I removed space in <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.9/weblogic-web-app.xsd"> and then clean build. It is working fine for me.

NewUser
  • 45
  • 3