我正在尝试学习JSF,并且在部署任何项目时遇到问题。我安装了以下内容:
Eclipse Kepler发布2
用于日食的JBoss工具
WildFly 8
Maven 3.2.1
Java JDK 8
mojarra 2.2.6
我在创建和下载示例项目的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
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\"}}"
另外,我不知道这是否相关,但是当我在eclipse中打开faces-config.xml文件时,它不会显示包含许多Web示例所显示的所有选项卡的页面。它只有图表,树和源的选项卡。这是因为示例是JSF 2.0,我使用的是JSF 2.2.6?
答案 0 :(得分:21)
请从依赖项中删除Mojarra。 WildFly已经附带了一个JSF实现,如果你用你的应用程序部署它,你会遇到这样的问题。
答案 1 :(得分:0)
使用JSF 2.1重新创建动态Web项目2.2为我解决了问题... 然后再一次相同的错误和更新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>