2013-04-20 15 views
22

Yüzler 2.2'yi kullanmaya çalışıyorum. Bir hata alıyorum.JSF 2.2 faces-config: Bilinmeyen Şema sürümü: 2.2

SEVERE: Critical error during deployment: 
com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/server/contracts/WEB-INF/faces-config.xml': Unknown Schema version: 2.2 
    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:749) 
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:348) 
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) 
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750) 
    at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550) 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366) 
    at com.sun.enterprise.web.WebModule.start(WebModule.java:498) 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917) 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901) 
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733) 
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019) 
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669) 
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109) 
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130) 
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269) 
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301) 
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461) 
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240) 
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389) 
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348) 
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363) 
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085) 
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95) 
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291) 
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259) 
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461) 
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212) 
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179) 
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117) 
    at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354) 
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195) 
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860) 
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757) 
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056) 
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229) 
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) 
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) 
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) 
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) 
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) 
    at java.lang.Thread.run(Thread.java:722) 
Caused by: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/server/contracts/WEB-INF/faces-config.xml': Unknown Schema version: 2.2 
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) 
    at java.util.concurrent.FutureTask.get(FutureTask.java:111) 
    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:747) 
    ... 44 more 
Caused by: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/server/contracts/WEB-INF/faces-config.xml': Unknown Schema version: 2.2 
    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:998) 
    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:942) 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:735) 
    ... 44 more 
Caused by: com.sun.faces.config.ConfigurationException: Unknown Schema version: 2.2 
    at com.sun.faces.config.ConfigManager$ParseTask.getDocument(ConfigManager.java:1101) 
    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:989) 
    ... 48 more 

yüzler-config.xml

<?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://java.sun.com/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> 

ben "glassfish3/glassfish/modüller/javax.faces.jar" dosya üzerinde son MTU versiyonunu kopyalanan bu example.

kodu.

Sorunu anlamıyorum.

cevap

65

JSF 2.2 şema ad alanı değişti. faces-config.xml böyle görünmek zorunda: Bu sorunun

<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

nedeni http://java.sun.com/xml/ns/javaee/web-facesconfig_2_2.xsd adres geçersiz olmasıdır. Bu nedenle, faces-config.xml dosyası

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

Ne yazık ki, aynı hatayı aldım Bu şekilde – Rhododendron

+0

Sadece yukarıdaki URL (http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd Burada sağlanan Oracle doğru bir şekilde karşıdan yüklemeler sağlanan ancak boş bir face-config.xml doğrulama yeteneğine sahip değildir. – egore911

1

Tutulma ile aynı problem vardı aşağıdaki kullanmak size tavsiyelerde bulunabilir. Hala bir uyarı ("Hayır dilbilgisi costraints ..) Ama uygulama çalışmalarını olsun bu benim yüzleri-config dosyasıdır.

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

Mesajlar Mesajlar denir properties.The dosyaları için taban dosya isimleri .properties (default) ve Messages_de.properties