4 Replies Latest reply: Jan 18, 2007 11:59 AM by TedGoddard RSS

    NullPointerException in D2DViewHandler.calculateRenderKitId

    Charles Crouch Expert

      I'm trying to integrate icefaces with a Seam app and am hitting a snag. Has anyone else seen/resolved this. When I hit the front page, or even debug.seam, I get the following

      java.lang.NullPointerException
       com.icesoft.faces.application.D2DViewHandler.calculateRenderKitId(D2DViewHandler.java:696)
       com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase.java:241)
       com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:170)
       com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
       com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
       org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      This looks very similar to the issue described here:
      http://www.icefaces.org/JForum/posts/list/3263.page#15483

      The setup is Icefaces 1.5.1, Seam 1.1GA, JSF 1.2. Facelets. I have not yet introduced any icefaces tags to the .xhtml pages

      When integrating icefaces I used the article here http://support.icesoft.com/jive/servlet/KbServlet/download/623-102-847/SeamKBArticle.txt and also the icefaces demo that comes bundled with Seam 1.1.GA as examples.

      Thanks

        • 1. Re: NullPointerException in D2DViewHandler.calculateRenderKi
          Guy Veraghtert Newbie

          Yes, I tried to combine JSF 1.2 with IceFaces and Facelets and came to the conclusion that this requires a lot of patching of IceFaces (despite Ted Goddard's claims elsewhere on this forum).
          I encountered and investigated your problem:
          Section 10.4.5 of the JSF 1.2 specification states that you must "provide a constructor that takes a single argument of the appropriate type (in casu ViewHandler), if you want that the custom implementation receives a reference to the implementation that was previously fulfilling the role."
          The D2DViewHandler uses the "original" (id est the Default ViewHandler) ViewHandler in the calculateRenderKitId method, unfortunately, the D2DSeamFaceletViewHandler doesn't provide the aforementioned constructor, so the original view handler is never passed in this custom view handler, causing the NullPointerException (as we all know, constructors aren't inherited). The patch is trivial, however, when you patch this, you will run into other issues. See for example my post in "Seam doesn't play with ICEFaces".

          Apparently the ICEFaces people don't seem to have a public bug tracking system (yet), ...

          • 2. Re: NullPointerException in D2DViewHandler.calculateRenderKi
            Jessica Sant Newbie

            I reproduced this using the "icefaces" seam example

            environment:
            Seam 1.1.GA
            JBoss 4.0.5.GA
            Sun RI 1.2

            I followed the "Running the booking example on JBoss with the JSF 1.2 RI" sticky (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=94738), namely:

            1- setup a configuration of JBossAS 4.0.5 to use the SunRI instead of myFaces
            2- modified the iceFaces\resources\META-INF\application.xml, commented out the el-api.jar and el-ri.jar:

            <!-- <module>
             <java>el-api.jar</java>
             </module>
             <module>
             <java>el-ri.jar</java>
             </module> -->
            

            3- modified iceFaces\resources\WEB-INF\faces-config.xml to use the SeamELResolver
            <application>
             <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
            </application>
            

            4- modified iceFaces\resources\WEB-INF\web.xml to use SunRI:
             <!-- MyFaces -->
             <!-- <listener>
             <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
             </listener> -->
            
             <!-- JSF RI -->
             <listener>
             <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
             </listener>
            


            5- built the ear, then removed the el-ri.jar and el-api.jar from the generated ear.
            6- deployed jboss-seam-icefaces.ear and icefaces-ds.xml to the SunRI configured JBossAS
            7- when I run, I get a NullPointerException

            10:41:31,890 ERROR [STDERR] Jan 16, 2007 10:41:31 AM com.sun.faces.config.ConfigureListener isJspTwoOne
            WARNING: Incorrect JSP version found, method getJspApplicationContext does not exist.
            10:41:31,906 ERROR [STDERR] Jan 16, 2007 10:41:31 AM com.sun.faces.config.ConfigureListener contextInitialized
            INFO: Completed initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context 'null'
            10:41:31,921 INFO [ResponseStateManager] using response state manager: com.icesoft.faces.webapp.xmlhttp.ResponseStateManager
            10:41:32,000 INFO [EARDeployer] Started J2EE application: file:/F:/jboss-4.0.5.GA-ejb3/server/default/deploy/jboss-seam-icefaces.ear
            10:41:37,531 ERROR [STDERR] Jan 16, 2007 10:41:37 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
            INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
            10:41:37,531 INFO [Events] no events.xml file found
            10:41:37,531 ERROR [STDERR] Jan 16, 2007 10:41:37 AM com.sun.faces.lifecycle.LifecycleImpl phase
            WARNING: executePhase(RESTORE_VIEW 1,com.icesoft.faces.context.BridgeFacesContext@1155013) threw exception
            java.lang.NullPointerException
             at com.icesoft.faces.application.D2DViewHandler.calculateRenderKitId(D2DViewHandler.java:696)
             at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase.java:241)
             at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:170)
             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
             at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
             at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:389)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            ....
            10:41:37,546 ERROR [PersistentFacesServlet] Exception executing lifecycle or setting up persistent context. java.lang.NullPointerException
            javax.faces.FacesException: java.lang.NullPointerException
             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:305)
             at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
             at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:389)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            ...
            10:41:37,562 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
            javax.servlet.ServletException: java.lang.NullPointerException
             at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:437)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            10:41:37,562 ERROR [[Persistent Faces Servlet]] Servlet.service() for servlet Persistent Faces Servlet threw exception
            javax.faces.FacesException: java.lang.NullPointerException
             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:305)
             at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
             at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:389)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            ...
            Caused by: java.lang.NullPointerException
             at com.icesoft.faces.application.D2DViewHandler.calculateRenderKitId(D2DViewHandler.java:696)
             at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase.java:241)
             at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:170)
             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
             ... 25 more
            


            • 4. Re: NullPointerException in D2DViewHandler.calculateRenderKi
              TedGoddard Newbie


              This specific bug has been addressed in ICEfaces 1.5.2, so that the seam-icefaces application is now functional with JSF 1.2.(Effects, such as the highlight effect, are not working, however.)