ICEfaces
  1. ICEfaces
  2. ICE-7961

NPE when using SessionRenderer with Seam

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.2
    • Fix Version/s: 1.8.3, EE-1.8.2.GA_P04
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 1.8.2
      JBoss Seam 2.2.2 Final
      JBoss 5.1.0 GA

      Description

      See forum posting. Hopefully poster can attach a simple sample to expedite the analysis of this issue to determine future work.

        Activity

        Hide
        Ted Goddard added a comment -

        This may be related or fixed by ICE-7942.

        Show
        Ted Goddard added a comment - This may be related or fixed by ICE-7942 .
        Hide
        Carsten Manshusen added a comment - - edited

        This is my Seam component that uses the SessionRenderer:

        @Name("administrationAction")
        @Scope(SESSION)
        public class AdministrationAction implements Serializable {
        ...

        /** Module import business component. */
        @In(create = true)
        private ModuleImportBc moduleImportBc = null;
        /** Push message manager. */
        @In
        private PushMsgManager pushMsgManager = null;

        ...

        /** Constructor. */
        public AdministrationAction()

        { SessionRenderer.addCurrentSession(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER); log.info("Current session added to message receiver push group."); }

        ...

        /** Update modules. */
        public void updateModules() {
        try

        { pushMsgManager.setMessage("grid.msg.module.import.inProgress", true); SessionRenderer.render(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER); moduleImportBc.importInputDatas(); moduleImportBc.updateModuleDatas(); pushMsgManager.setMessage(null, true); SessionRenderer.render(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER); statusMessages.addFromResourceBundle(INFO, "administration.msg.updateModules.successful"); }

        catch (JpaException e)

        { statusMessages.addFromResourceBundle(ERROR, "administration.msg.updateModules.failed"); } catch (CsvFileException e) { statusMessages.addFromResourceBundle(ERROR, "administration.msg.updateModules.failed"); }

        }

        ...
        }

        The PushMsgManager is the application scoped component that stores the message data to render with the push mechanism.
        After calling "SessionRenderer.render(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER)" the following exception is thrown:

        14:14:58,825 ERROR [D2DFaceletViewHandler] Problem in renderResponse: null
        java.lang.NullPointerException
        at com.icesoft.faces.util.DOMUtils.domDiff(DOMUtils.java:256)
        at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:34)
        at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:924)
        at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:191)
        at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:285)
        at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:176)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:312)
        at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:662)

        Here is my environment:

        ICEfaces 1.8.2
        JBoss Seam 2.2.2 Final
        JBoss 5.1.0 GA

        Show
        Carsten Manshusen added a comment - - edited This is my Seam component that uses the SessionRenderer: @Name("administrationAction") @Scope(SESSION) public class AdministrationAction implements Serializable { ... /** Module import business component. */ @In(create = true) private ModuleImportBc moduleImportBc = null; /** Push message manager. */ @In private PushMsgManager pushMsgManager = null; ... /** Constructor. */ public AdministrationAction() { SessionRenderer.addCurrentSession(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER); log.info("Current session added to message receiver push group."); } ... /** Update modules. */ public void updateModules() { try { pushMsgManager.setMessage("grid.msg.module.import.inProgress", true); SessionRenderer.render(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER); moduleImportBc.importInputDatas(); moduleImportBc.updateModuleDatas(); pushMsgManager.setMessage(null, true); SessionRenderer.render(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER); statusMessages.addFromResourceBundle(INFO, "administration.msg.updateModules.successful"); } catch (JpaException e) { statusMessages.addFromResourceBundle(ERROR, "administration.msg.updateModules.failed"); } catch (CsvFileException e) { statusMessages.addFromResourceBundle(ERROR, "administration.msg.updateModules.failed"); } } ... } The PushMsgManager is the application scoped component that stores the message data to render with the push mechanism. After calling "SessionRenderer.render(PushMsgReceiver.PUSH_GROUP_PUSH_MSG_RECEIVER)" the following exception is thrown: 14:14:58,825 ERROR [D2DFaceletViewHandler] Problem in renderResponse: null java.lang.NullPointerException at com.icesoft.faces.util.DOMUtils.domDiff(DOMUtils.java:256) at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:34) at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:924) at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:191) at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:285) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:176) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:312) at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:662) Here is my environment: ICEfaces 1.8.2 JBoss Seam 2.2.2 Final JBoss 5.1.0 GA
        Hide
        Judy Guglielmin added a comment - - edited

        actually created a MessageMgr bean that was injected into a Session scoped bean which implemented push using SessionRenderer and found that the push triggered event was unable to find the Session-scoped bean that was injected into it after the push.
        Work-around would be to go back to tested API which works well with seam, so please see PushTest.zip which contains a sample of this. works for Session or conversation-scoped backing beans and using seam injection. SessionRenderer is newer api and in ICEfaces-3 incarnation works well with CDI on newer application servers.

        To create PushTest project:-

        edit build.properties to set proper targets for jboss5.1.0.GA, icefaces home directory and jboss-seam-2.2.2.Final home directory and then run:-
        1) ant copy-libs
        2) ant deploy or ant explode (if you want archived deploy or exploded deploy)

        Show
        Judy Guglielmin added a comment - - edited actually created a MessageMgr bean that was injected into a Session scoped bean which implemented push using SessionRenderer and found that the push triggered event was unable to find the Session-scoped bean that was injected into it after the push. Work-around would be to go back to tested API which works well with seam, so please see PushTest.zip which contains a sample of this. works for Session or conversation-scoped backing beans and using seam injection. SessionRenderer is newer api and in ICEfaces-3 incarnation works well with CDI on newer application servers. To create PushTest project:- edit build.properties to set proper targets for jboss5.1.0.GA, icefaces home directory and jboss-seam-2.2.2.Final home directory and then run:- 1) ant copy-libs 2) ant deploy or ant explode (if you want archived deploy or exploded deploy)
        Hide
        Ken Fyten added a comment -

        Marking this Won't Fix as the workaround to use the PushRenderer API is available as an alternate approach.

        Show
        Ken Fyten added a comment - Marking this Won't Fix as the workaround to use the PushRenderer API is available as an alternate approach.

          People

          • Assignee:
            Judy Guglielmin
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: