eclipse 部署到 FireFly 的 JSF 异常,标记名为 inputFile null handler-class

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22726308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:37:17  来源:igfitidea点击:

JSF exception deploying to FireFly, tag named inputFile null handler-class

eclipsejsf

提问by user3474794

I am trying to learn JSF and am having a problem deploying any project. I have installed the following:

我正在尝试学习 JSF,但在部署任何项目时遇到问题。我已经安装了以下内容:

Eclipse Kepler release 2
JBoss tools for eclipse
WildFly 8
Maven 3.2.1
Java JDK 8
mojarra 2.2.6

Eclipse Kepler 发布 2
JBoss 工具,用于 Eclipse
WildFly 8
Maven 3.2.1
Java JDK 8
mojarra 2.2.6

I am having this problem with JSF projects I create and downloaded sample project. When I deploy the project to WildFly in eclipse it throws the exception:

我在创建和下载示例项目的 JSF 项目中遇到了这个问题。当我在 Eclipse 中将项目部署到 WildFly 时,它会引发异常:

JBAS014777:   Services which failed to start: service jboss.undertow.deployment.default-server.default-host./Test: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./Test: Failed to start service

The Test.war.failed file in the deployment folder of WildFly has the following:

WildFly的部署文件夹中的Test.war.failed文件有以下内容:

"{\"JBAS014671: Failed services\" => {\"jboss.undertow.deployment.default-server.default-host./Test\" => \"org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./Test: Failed to start service
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
Caused by: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined\"}}"

Also, I don't know if this is related, but when I open the faces-config.xml file in eclipse it doesn't show the page with all the tabs that the many web examples show. It only has tabs for Diagram, Tree, and Source. Is this because the examples are JSF 2.0 and I am using JSF 2.2.6?

另外,我不知道这是否相关,但是当我在 eclipse 中打开 faces-config.xml 文件时,它没有显示包含许多 Web 示例显示的所有选项卡的页面。它只有图表、树和源的选项卡。这是因为示例是 JSF 2.0 而我使用的是 JSF 2.2.6 吗?

回答by chkal

Please remove Mojarra from the dependencies. WildFly already ships with an JSF implementation and if you deploy one with your app, you run into such problems.

请从依赖项中删除 Mojarra。WildFly 已经附带了一个 JSF 实现,如果你在你的应用程序中部署一个,你会遇到这样的问题。

回答by irshad MIA

Recreating the dynamic web project with JSF 2.1 instead 2.2 resolved the issue for me once... and then once again the same error and updating web.xml as follows worked fine...

使用 JSF 2.1 而不是 2.2 重新创建动态 Web 项目为我解决了一次问题......然后再次出现相同的错误并更新 web.xml 如下工作正常......

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">

<display-name>JavaServerFaces</display-name>

<!-- Change to "Production" when you are ready to deploy -->
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

<!-- Welcome page -->
<welcome-file-list>
    <welcome-file>faces/hello.xhtml</welcome-file>
</welcome-file-list>

<!-- JSF mapping -->
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<!-- Map these files with JSF -->
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

    </web-app>