我在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
更新我如何解决此问题?
你指定了 http://xmlns.jcp.org/xml/ns/javaee
两次,所以删除一个。
对我来说,在编辑faces-config.xml时,删除重复的命名空间会产生令人不快的副作用,即禁用内容辅助。
具有“重复”命名空间的这些头文件在任何地方都被指定,JSF规范中特别提到了faces-config。甚至是W3C XML Schema规范的特性 一个类似的例子。
所以看起来这个标题是正确的。安装Eclipse和JBoss工具的最新更新为我解决了这个问题。
它可能与这些JBoss Tools问题有关: JBIDE-14439, JBIDE-15605。
禁用XSD文件的缓存为我解决了问题 - 使用Eclipse Neon,相关选项位于Window-> Preferences-> General-> Network Connections-> Cache-> Disable Caching。检查该框,然后清理并构建。我认为在我的情况下发生的事情是我试图在没有互联网连接的wifi上重建,Eclipse试图验证这些文件而不能,并决定显示这种类型的错误。
你有两个选择(我只发现了这些......哈哈):
1 - 你指定了 http://xmlns.jcp.org/xml/ns/javaee 两次,所以删除一个。(由Shukti)
2-如果你得到一些像“cvc-complex-type ......”这样的错误,那么就把它放进去吧 <from-view-id>something here </from-view-id>
在导航规则中每行有错误。 (错误将消失,但是,我不能确保它对你有用)。