【问题标题】:Glassfish EAR deployment time exceptionGlassfish EAR 部署时间异常
【发布时间】:2013-04-18 07:48:17
【问题描述】:

我正在尝试将 EAR 部署到 Glassfish,它在 EAR 中使用 JSF 和 WAR 文件有 faces-config.xml 即在 WEB-INF 下。但是当我尝试部署到 Glassfish 服务器时,我遇到了以下异常:

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 文件,因为它很大而且仅供参考,我正在尝试部署 Duke 的书店 Oracle 示例 Java EE 应用程序,但我遇到了这个错误。我尝试在 Google 中搜索,但没有得到任何有用的结果。你能帮帮我吗?如果需要,我可以提供更多信息。

我的 faces-config.xml 可以在这里找到:http://temp-share.com/show/gFHKBRxsY

【问题讨论】:

    标签: java jsf glassfish glassfish-3


    【解决方案1】:

    您的faces-config.xml 可能有问题。
    也许您缺少&gt; 或类似的东西。

    您必须发布或链接到该文件以提供更多信息。

    更新:

    由于您已链接到实际的 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">
    

    实际上与您在问题中发布的相同:)

    【讨论】:

    • 不,它不起作用,即使现在我在 Glassfish 中也遇到同样的错误。
    • 我正在使用 JSF 2.2 并且我有同样的错误。如果我使用 2.0 旧的标头,我可以部署它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-27
    • 1970-01-01
    • 2011-10-28
    相关资源
    最近更新 更多