ICEfaces:没有为此应用程序例外配置的工厂

时间:2015-03-08 11:42:30

标签: eclipse jsf jsf-1.2 icefaces icefaces-1.8

我正在尝试运行一个简单的“Hello World'使用JSF1.2和ICEfaces 1.8的应用程序。 我已经使用ICEFaces插件为Galileo,MyFaces库下载了所有的罐子:

  • 后向移植-util的-concurrent.jar
  • 公地BeanUtils的-1.7.0.jar
  • 公地编解码器-1.3.jar
  • 公地集合-3.2.jar
  • 公地消化器-1.8.jar
  • 公地发现-0.4.jar
  • 公地fileupload.jar
  • 共享记录-1.1.1.jar
  • FastInfoset.jar
  • icefaces.jar
  • ICEfaces的-comps.jar
  • 的jstl.jar
  • jxl.jar
  • krysalis-的jCharts t-1.0.0-α-1.jar
  • MyFaces的-API-1.2.9.jar
  • MyFaces的-IMPL-1.2.9.jar
  • standard.jar
  • ui.jar

将它们添加到lib文件夹,并构建路径。

我的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>HelloWorld(ICE)</display-name>
  <welcome-file-list>
   <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
  </context-param>
  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.jspx</param-value>
  </context-param>
  <context-param>
    <description>To allow multiple windows for a single application.</description>
    <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <description>Turn on/off application-wide synchronous or asynchronous updates.</description>
    <param-name>com.icesoft.faces.synchronousUpdate</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <description>Google Maps API key is required if gMap component is used. Sign up for an API key from http://code.google.com/apis/maps/signup.html</description>
    <param-name>com.icesoft.faces.gmapKey</param-name>
    <param-value>ABQIAAAADlu0ZiSTam64EKaCQr9eTRTOTuQNzJNXRlYRLknj4cQ89tFfpxTEqxQnVWL4k55OPICgF5_SOZE06A</param-value>
  </context-param>
  <context-param>
    <param-name>com.icesoft.faces.uploadDirectory</param-name>
    <param-value>upload</param-value>
  </context-param>
  <context-param>
    <param-name>com.icesoft.faces.uploadMaxFileSize</param-name>
    <param-value>4048576</param-value>
  </context-param>
  <servlet>
    <servlet-name>Persistent Faces Servlet</servlet-name>
    <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Persistent Faces Servlet</servlet-name>
    <url-pattern>*.iface</url-pattern>
    <url-pattern>*.jspx</url-pattern>
    <url-pattern>*.jsf</url-pattern>
    <url-pattern>/xmlhttp/*</url-pattern>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>Blocking Servlet</servlet-name>
    <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Blocking Servlet</servlet-name>
    <url-pattern>/block/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>uploadServlet</servlet-name>
    <servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>uploadServlet</servlet-name>
    <url-pattern>/uploadHtml</url-pattern>
  </servlet-mapping>
  <listener>
    <listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
  </listener>
</web-app>

我的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_1_2.xsd" version="1.2">
  <application>
    <view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
  </application>
</faces-config>

的index.jsp:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
  <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>

      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>Insert title here</title>
      </head>

      <body>
        <jsp:forward page="ICEfacesPage.iface" />
      </body>

      </html>

ICEfacesPage.jspx:

<?xml version="1.0" encoding="utf-8" ?>
<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component">

  <jsp:directive.page contentType="text/html;charset=utf-8" />

  <f:view>
    <ice:outputDeclaration doctypeRoot="HTML" doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN" doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
    <html>

    <head>
      <title>ICEfaces, Ajax for Java EE</title>
      <link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css" />
    </head>

    <body>
      <ice:outputText value="Welcome to ICEfaces." />
      <ice:form>
        <ice:panelGroup draggable="true" style="width:200px;border:1px solidblack;">
          <ice:outputText value="Hello World!" />
        </ice:panelGroup>
      </ice:form>
    </body>

    </html>
  </f:view>
</jsp:root>

例外:

Servlet.service() for servlet Persistent Faces Servlet threw exception java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all
configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might
be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this;
<listener>
  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106) at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.
<clinit>(ReceiveSendUpdates.java:38) at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.
  <init>(MainSessionBoundServlet.java:136) at com.icesoft.faces.webapp.http.servlet.MainServlet$3.newServer(MainServlet.java:87) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.checkSession(SessionDispatcher.java:86) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:45)
    at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23) at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680) at org.apache.jsp.index_jsp._jspService(index_jsp.java:64) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)

我不明白为什么面部初始化不起作用。请帮我弄清楚如何解决这个问题。

非常感谢你的时间。

1 个答案:

答案 0 :(得分:0)

找出问题所在。

我只需要将以下映射添加到web.xml

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>

来源: https://books.google.co.in/books?id=2rX6SMAIr-QC&pg=PT78&dq=No+Factories+configured+for+this+Application.&hl=en&sa=X&ei=Io_8VMvVM4arOq2WgdAK&ved=0CB0Q6AEwAA#v=onepage&q&f=false

相关问题