0

I made a new IceFace project and tried to run it on my local host, however I got the following error message:

Nov 4, 2013 11:41:10 PM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring file:/Users/Alex/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/TEST/WEB-INF/faces-config.xml for modifications
2013-11-04 23:41:10.563:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
    2013-11-04 23:41:11.623:WARN:oejh.HttpGenerator:Ignoring extra content <html>

<head>
</head>
<body>

</body>
</html>
Nov 4, 2013 11:41:11 PM org.icefaces.impl.application.ExtendedExceptionHandler handle
WARNING: queued exception
java.lang.NullPointerException
    at org.icepush.util.ExtensionRegistry.getBestExtension(ExtensionRegistry.java:69)
    at org.icefaces.impl.push.servlet.ICEpushResourceHandler$ICEpushResourceHandlerImpl.beforePhase(ICEpushResourceHandler.java:171)
    at org.icefaces.impl.push.servlet.ICEpushResourceHandler.beforePhase(ICEpushResourceHandler.java:111)
    at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:368)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool

and here is my 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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>TEST</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.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>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    <url-pattern>*.jsf</url-pattern>
    <url-pattern>/icefaces/*</url-pattern>
  </servlet-mapping>
  <context-param>
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
  </context-param>
  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
  </context-param>
  <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
  </listener>
  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
  </context-param>
  <context-param>
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.icefaces.coalesceResources</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <param-name>org.icefaces.strictSessionTimeout</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.icefaces.ace.gmapKey</param-name>
    <param-value>AIzaSyAATyWVqT2qNusNGmcVTyQ0QmymkpU-B5o</param-value>
  </context-param>
  <mime-mapping>
    <extension>png</extension>
    <mime-type>image/png</mime-type>
  </mime-mapping>
</web-app>

The two files I have under my WebContext is index.jsp which redirects to index.jsf and the other file is index.xhtml which contains the following :

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"
        xmlns:ace="http://www.icefaces.org/icefaces/components"
    >
    <h:head>
        <title>ICEfaces 3</title>
    </h:head>
    <h:body>
       <h:form id="iceForm">
        <ace:panel header="Welcome to ICEfaces">
      <h:panelGrid columns="1">
        <ace:linkButton id="linkButton1" value="ICEfaces Overview" href="http://wiki.icesoft.org/display/ICE/ICEfaces+Overview"></ace:linkButton>
        <ace:linkButton id="linkButton2" value="General Documentation" href="http://wiki.icesoft.org/display/ICE/ICEfaces+Documentation"></ace:linkButton>
        <ace:linkButton id="linkButton4" value="Tutorials" href="http://www.icesoft.org/community/tutorials-samples.jsf"></ace:linkButton>
        <ace:linkButton id="linkButton5" value="ACE components" href="http://wiki.icesoft.org/display/ICE/ACE+Components"></ace:linkButton>
     </h:panelGrid>
    </ace:panel>
       </h:form>
    </h:body>
</html>

i have tried switching the the welcome-file-list to

  <welcome-file-list>
    <welcome-file>index.xhtml</welcome-file> <!--switched extension from html to xhtml -->
  <welcome-file-list>

with this change my localhost will not crash, however I get a blank page (none of my JSF element shows up) I'm having a feeling it is because none of my JSf tags are getting parsed, however i don't really know where the problem is, can anyone please help me?

other information: Im using Eclipse Java EE IDE for Web Developers ICEFACES 3.3.0 Tomcat 3.0

Thanks.


update:

Changed my web.xml welcome-file-list to

  <welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>
  </welcome-file-list>

and changed my servlet-mapping to

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

There is no crash now, but my JSF elements does not show up, i only get a blank page.


UPDATES:

Web.xml

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

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

I have tried .jsf and .xhtml inside the url-pattern tag both no luck

index.jsp

<html>
<head>
</head>
<body>
      <%
        //response.sendRedirect("./index.jsf");
    %> 

    <jsp:forward page="main.jsf"/>

</body>
</html>

after Getting my page to load up, it becomes blank, so i right click on my page and view source, and this is what i found...

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"
        xmlns:ace="http://www.icefaces.org/icefaces/components"
    >
    <h:head>
        <title>ICEfaces 3</title>
    </h:head>
    <h:body>
       <h:form id="iceForm">
        <ace:panel header="Welcome to ICEfaces">
      <h:panelGrid columns="1">
        <ace:linkButton id="linkButton1" value="ICEfaces Overview" href="http://wiki.icesoft.org/display/ICE/ICEfaces+Overview"></ace:linkButton>
        <ace:linkButton id="linkButton2" value="General Documentation" href="http://wiki.icesoft.org/display/ICE/ICEfaces+Documentation"></ace:linkButton>
        <ace:linkButton id="linkButton4" value="Tutorials" href="http://www.icesoft.org/community/tutorials-samples.jsf"></ace:linkButton>
        <ace:linkButton id="linkButton5" value="ACE components" href="http://wiki.icesoft.org/display/ICE/ACE+Components"></ace:linkButton>
     </h:panelGrid>
    </ace:panel>
       </h:form>
    </h:body>
</html>

Any ideas why this is happening?

  • Your welcome file needs to be index.jsp which should have a call to a forward page with jsf extension and not xhtml because you mapped faces servlet to *.jsf – Narayana Nagireddi Nov 05 '13 at 20:43
  • I tried what you said, but its still not working. it does not crash but my JSF element does not show up on the screen. all i see is a blank page. – user2954899 Nov 06 '13 at 02:23
  • Your update is wrong. Change welcome file to index.jsp and in index.jsp, add this, `` and map `*.jsf` to Faces Servlet, if it doesn't work with `*.xhtml`. Also you can redirect instead of forward but then the url will change which you wouldn't want to happen. – Narayana Nagireddi Nov 07 '13 at 01:49
  • Also change index.jsf to something different like main.jsf to avoid conflicting names, its a poor naming convention. – Narayana Nagireddi Nov 07 '13 at 03:53
  • Sorry for the late reply, I update the things things you mention, however I got this error now `HTTP ERROR 404 Problem accessing /TEST/main.jsf. Reason: Not Found` – user2954899 Nov 09 '13 at 05:23
  • The file main.xhtml is under the WebContent directory, however i am confuse why I am getting this error... Please look at the post again, i have updated my changes – user2954899 Nov 09 '13 at 05:30
  • Okay, now I can load up the page, however i get a blank page, any ideas why this is happening? i click the View source and i see my jsf element still not parsed, ill post it above. – user2954899 Nov 09 '13 at 20:08
  • Change the url pattern to *.jsf because the index.jsp has main.jsf in it. And what url are you using to open? And do you see any startup errors when the application starts or when the web module is deployed? – Narayana Nagireddi Nov 10 '13 at 01:06
  • I tried, still no luck, and no there are no errors. – user2954899 Nov 16 '13 at 23:12

0 Answers0