2013-04-18 94 views
0

我想部署到EAR Glassfish使用內部EAR的JSF和WAR文件有faces-config.xml即在WEB-INF下。但是,當我嘗試部署到GlassFish服務器我得到下面的異常:Glassfish EAR部署時間異常

java.lang.IllegalStateException: ContainerBase.addChild: start 
org.apache.catalina.LifecycleException: java.lang.RuntimeException: 
com.sun.faces.config.ConfigurationException: 
java.util.concurrent.ExecutionException: 
com.sun.faces.config.ConfigurationException: 
Unable to parse document 'jndi:/server/WEB-INF/faces-config.xml': null 

我不知道是什麼問題,Eclipse中沒有而寫faces-config.xml中給我任何錯誤,但GlassFish是給出上述錯誤。是的,我在WEB-INF文件夾中有faces-config.xml文件。

這裏是faces-config.xml文件的樣本:

<?xml version='1.0' encoding='UTF-8'?> 

<faces-config 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_0.xsd" 
version="2.0"> 
<!-- there are other elements here --> 
</faces-config> 

我不能發佈整個XML文件,因爲它是巨大的,僅供參考,我嘗試部署杜克大學的書店甲骨文樣本Java EE應用程序,但我堅持有這個錯誤。我試着在谷歌搜索,但沒有得到任何有用的結果。你能幫助我嗎?如果需要,我可以提供更多信息。

我faces-config.xml中可以在這裏找到:http://temp-share.com/show/gFHKBRxsY

回答

0

有可能是錯誤的東西在你的faces-config.xml
也許你錯過了>或類似的東西。

您必須發佈或鏈接到該文件才能提供更多信息。

更新:

正如你已經鏈接到您的實際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://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 
    version="2.0"> 

的錯誤是在第二行... XML命名空間是錯誤的。

你必須將它更改爲:

<?xml version='1.0' encoding='UTF-8'?> 
<faces-config version="2.0" 
    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_0.xsd"> 

其實一樣的,你已經張貼在你的問題:)

+0

請參閱我的問題編輯。 –

+0

@PradeepSimha看看我的回答編輯:) – unwichtich

+0

不,它不起作用,即使現在我在Glassfish中也有同樣的錯誤。 –