Java Glassfish部署:未知架构版本2.2

Java Glassfish部署:未知架构版本2.2,java,jsf,glassfish,glassfish-3,jsf-2.2,Java,Jsf,Glassfish,Glassfish 3,Jsf 2.2,我在将应用程序部署到Glassfish时遇到了一些问题。我用的是Glassfish 3.x。当我将此应用程序部署到Tomcat7.x时,没有出现任何问题。然而,当我部署到Glassfish时,它说有一个未知的模式版本2.2。然而,据我的研究所知,我的faces-config.xml应该是正确的 这是我的faces-config.xml <?xml version="1.0"?> <faces-config version="2.2" xmlns="http://java.sun

我在将应用程序部署到Glassfish时遇到了一些问题。我用的是Glassfish 3.x。当我将此应用程序部署到Tomcat7.x时,没有出现任何问题。然而,当我部署到Glassfish时,它说有一个未知的模式版本2.2。然而,据我的研究所知,我的faces-config.xml应该是正确的

这是我的faces-config.xml

<?xml version="1.0"?>
<faces-config version="2.2" xmlns="http://java.sun.com/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">

    <!-- Enable Spring with JSF -->        
    <application>
        <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    </application>

</faces-config>

faces config.xml
中的xmlns错误

试试这个:

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


但是如果您仔细看一下,就会发现JSF2.2在GlassFish3上并不完全受支持。

JSF2.2不是需要GlassFish4而不是3吗?
<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>