问题 引用文件包含错误(jar:file:/.../plugins/org.jboss.tools.jst.web_3.5.0.Final-v20130717-0309-B75.jar!/catalog/web-facesconfig_2_2.xsd)


我在eclipse和文件中的JSF项目中创建 faces-config.xml中 给出错误

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>

当我删除以下行时,错误指示消失 faces-config.xml中

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

更新我如何解决此问题?


8105
2017-09-17 06:13


起源

你的罐子是JSF 2.2版。 ? - erencan
@erencan是的!在faces-config.xml中显示上面的version =“2.2” - Shahid Ghafoor
我要求jar版本。 - erencan
@erencan是的! JSF 2.2 (Mojarra 2.2.0)\mojarra-2.2.0-FCS\lib\javax.faces.jar - Shahid Ghafoor
这对我有用。 - erencan


答案:


你指定了 http://xmlns.jcp.org/xml/ns/javaee 两次,所以删除一个。


9
2017-09-28 15:21



JSF 2.2的faces-config.xml是使用重复的命名空间创建的。所以上面的答案实际上是正确的。删除第一次出现的'xmlns.jcp.org/xml/ns/javaee”;问题应该解决。 - ThiagoPonte
这个答案是对的。 - BalusC


对我来说,在编辑faces-config.xml时,删除重复的命名空间会产生令人不快的副作用,即禁用内容辅助。

具有“重复”命名空间的这些头文件在任何地方都被指定,JSF规范中特别提到了faces-config。甚至是W3C XML Schema规范的特性 一个类似的例子

所以看起来这个标题是正确的。安装Eclipse和JBoss工具的最新更新为我解决了这个问题。

它可能与这些JBoss Tools问题有关: JBIDE-14439JBIDE-15605


2
2018-02-18 13:32





禁用XSD文件的缓存为我解决了问题 - 使用Eclipse Neon,相关选项位于Window-> Preferences-> General-> Network Connections-> Cache-> Disable Caching。检查该框,然后清理并构建。我认为在我的情况下发生的事情是我试图在没有互联网连接的wifi上重建,Eclipse试图验证这些文件而不能,并决定显示这种类型的错误。


2
2018-05-08 18:22



我不必禁用缓存,但清除当前的缓存条目可以解决问题。 - Barry Knapp


你有两个选择(我只发现了这些......哈哈):

1 - 你指定了 http://xmlns.jcp.org/xml/ns/javaee 两次,所以删除一个。(由Shukti)

2-如果你得到一些像“cvc-complex-type ......”这样的错误,那么就把它放进去吧 <from-view-id>something here </from-view-id> 在导航规则中每行有错误。 (错误将消失,但是,我不能确保它对你有用)。


1
2017-07-26 17:32