JSF 2.2 faces-config: Unknown Schema version: 2.2

后端 未结 3 2039
小鲜肉
小鲜肉 2020-12-15 17:40

I\'m trying to use the Faces 2.2. I get an error.

SEVERE: Critical error during deployment: 
com.sun.faces.config.ConfigurationException: java.util.concurren         


        
相关标签:
3条回答
  • 2020-12-15 18:11

    The reason of this problem is that http://java.sun.com/xml/ns/javaee/web-facesconfig_2_2.xsd address is invalid. Therefore, I can advise you to use following faces-config.xml file

    <?xml version='1.0' encoding='UTF-8'?>
    
        <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://java.sun.com/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2_2.xsd">
           <application>
    
                <resource-library-contracts>
                    <contract-mapping>
                        <url-pattern>/user/*</url-pattern>
                        <contracts>blue</contracts>
                    </contract-mapping>
                    <contract-mapping>
                        <url-pattern>*</url-pattern>
                        <contracts>red</contracts>
                    </contract-mapping>
                </resource-library-contracts>
            </application>
    
        </faces-config>
    
    0 讨论(0)
  • 2020-12-15 18:20

    I had the same problem with eclipse. I still get a warning ("No grammar costraints..) But the application works. this is my faces-config file:

    <?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/web-facesconfig_2_2.xsd"
        version="2.2">
    
    
        <application>
                <action-listener>org.primefaces.application.DialogActionListener</action-    listener>
                <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
                <view-handler>org.primefaces.application.DialogViewHandler</view-handler>
    
            <locale-config>
                 <default-locale>de</default-locale>
                 <supported-locale>en</supported-locale>
            </locale-config>
    
            <resource-bundle>
                <base-name>Messages</base-name>
                <var>msg</var>
            </resource-bundle>
        </application>
    
    </faces-config>
    

    Messages is the base file names for the properties.The files are called Messages.properties (default) and Messages_de.properties.

    0 讨论(0)
  • 2020-12-15 18:21

    The schema namespace for JSF 2.2 changed. The faces-config.xml has to look like this:

    <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>
    
    0 讨论(0)
提交回复
热议问题