简体   繁体   English

无法找到XML模式名称空间的Spring NamespaceHandler [http://java.sun.com/xml/ns/javaee]

[英]Unable to locate Spring NamespaceHandler for XML schema namespace [http://java.sun.com/xml/ns/javaee]

I am developing portlet+jsf 我正在开发portlet + jsf

It's my faces-config.xml file 这是我的faces-config.xml文件

<?xml version="1.0" encoding="UTF-8"?>
        <faces-config version="2.1" 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">

            <application>
                <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
                <navigation-handler>
                    org.springframework.webflow.executor.jsf.FlowNavigationHandler
                </navigation-handler>
                <variable-resolver>
                    org.springframework.web.jsf.DelegatingVariableResolver
                </variable-resolver>
            </application>
            <lifecycle>
                <phase-listener>com.liferay.faces.util.lifecycle.DebugPhaseListener</phase-listener>
                <phase-listener>com.liferay.faces.util.lifecycle.ViewScopePhaseListener</phase-listener>
                <phase-listener>org.springframework.webflow.executor.jsf.FlowPhaseListener</phase-listener>
            </lifecycle>

        </faces-config>

When I am trying deploy my portlet, I get following exception: 当我尝试部署Portlet时,出现以下异常:

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://java.sun.com/xml/ns/javaee]
Offending resource: ServletContext resource [/WEB-INF/context/faces-config.xml]

    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:316) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1416) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:190) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:255) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
    ... 32 common frames omitted

Can anybody help me resolve this problem? 有人可以帮我解决这个问题吗?

Try replacing 尝试更换

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd

with

xsi:schemaLocation="http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2‌​_1.xsd"

EDIT: Apparently, the version 2.1 had some issues, with getting the schemaLocation from former location. 编辑:显然,2.1版存在一些问题,从以前的位置获取schemaLocation It has been fixed. 已修复。 But according to the error, I think that the xml isn't able to find the schema. 但是根据错误,我认为xml无法找到架构。 So you can try replacing it and check if it works. 因此,您可以尝试更换它,并检查它是否有效。 Hope I was of some use. 希望我有用。

I have same issue,go to eclipse-java facet uncheck it,click ok then clean build and start server.It should work fine then again go to java facet check it runtime tomcat server then restart server. 我有同样的问题,去eclipse-java facet取消选中它,单击“确定”,然后清理构建并启动服务器。它应该可以正常工作,然后再次转到java facet检查它的运行时tomcat服务器,然后重新启动服务器。 It worked for me. 它为我工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 配置问题:无法找到XML架构命名空间的Spring NamespaceHandler [http://java.sun.com/xml/ns/javaee] - Configuration problems: Unable to locate Spring NamespaceHandler for XML schema namespace [http://java.sun.com/xml/ns/javaee] 我的 web.xml 命名空间从“http://java.sun.com/xml/ns/javaee”移动到“http://xmlns.jcp.org/xml/ns/javaee” - moving from “http://java.sun.com/xml/ns/javaee” to “http://xmlns.jcp.org/xml/ns/javaee” for my web.xml namespace 无法找到用于XML模式名称空间的Spring NamespaceHandler [http://jboss.org/xml/ns/javax/validation/configuration] - Unable to locate Spring NamespaceHandler for XML schema namespace [http://jboss.org/xml/ns/javax/validation/configuration] 引用的文件包含错误 (http://java.sun.com/xml/ns/javaee/web-app.xsd) - Referenced file contains errors (http://java.sun.com/xml/ns/javaee/web-app.xsd) 找不到 XML 模式命名空间的 Spring NamespaceHandler - Unable to locate Spring NamespaceHandler for XML schema namespace 无法找到用于XML模式名称空间的Spring NamespaceHandler - Unable to locate Spring NamespaceHandler for XML schema namespace 在Websphere AS中针对http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd禁用XSD验证 - Disable XSD validation against http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd in Websphere AS Spring 3.0 - 无法找到XML模式命名空间的Spring NamespaceHandler [http://www.springframework.org/schema/security] - Spring 3.0 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security] 无法找到XML模式命名空间spring-batch的Spring NamespaceHandler - Unable to locate Spring NamespaceHandler for XML schema namespace spring-batch 无法通过eclipse找到XML模式名称空间[http://camel.apache.org/schema/spring]的Spring NamespaceHandler - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring] through eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM