MyFaces Core
  1. MyFaces Core
  2. MYFACES-1481

MyFacesGenericPortlet does not work in a cluster

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.4
    • Fix Version/s: 1.1.5
    • Component/s: Portlet_Support
    • Labels:
      None

      Description

      The problem is that ServletFacesContextImpl is not serializable and processAction places one in the session.

      Here is a link to a discussion on the JBoss Forum.
      http://jboss.org/index.html?module=bb&op=viewtopic&p=3981103#3981103

      Here is a link to the workaround I created.
      http://taylor.cvs.sourceforge.net/taylor/taylor/commons/src/main/java/net/taylor/portlet/MyFacesGenericPortlet.java?view=markup

        Issue Links

          Activity

          Hide
          Stan Silvert added a comment -

          Thanks for researching this. It is something I hadn't considered. However, I don't think that your workaround is the best approach.

          The FacesContext should be removed from the session at the end of the request. Since session replication should not happen in the middle of the request, the problem would be solved.

          I have to figure out how to make this all work properly though. render() can be called without a processAction(). In that case we need to create a new FacesContext instead of using the one in the session.

          Stan

          Show
          Stan Silvert added a comment - Thanks for researching this. It is something I hadn't considered. However, I don't think that your workaround is the best approach. The FacesContext should be removed from the session at the end of the request. Since session replication should not happen in the middle of the request, the problem would be solved. I have to figure out how to make this all work properly though. render() can be called without a processAction(). In that case we need to create a new FacesContext instead of using the one in the session. Stan
          Hide
          John Gilbert added a comment -

          That sounds great!

          Show
          John Gilbert added a comment - That sounds great!
          Hide
          Stan Silvert added a comment -

          John,

          I just committed some changes to MyFacesGenericPortlet. FacesContext will be removed from the session after each render().

          I don't have a cluster set up so I can't test it out. Can you test it for me to see if replication works?

          Thanks,

          Stan

          Show
          Stan Silvert added a comment - John, I just committed some changes to MyFacesGenericPortlet. FacesContext will be removed from the session after each render(). I don't have a cluster set up so I can't test it out. Can you test it for me to see if replication works? Thanks, Stan
          Hide
          Stan Silvert added a comment -

          To fix MYFACES-1481, I had to completely change the fix for MYFACES-1070. Hopefully, it still works.

          Show
          Stan Silvert added a comment - To fix MYFACES-1481 , I had to completely change the fix for MYFACES-1070 . Hopefully, it still works.
          Hide
          Stan Silvert added a comment -

          I occurs to me that the FacesContext also needs to be removed from the session at the end of processAction. I have learned that some Portal containers actually do a redirect after processAction instead of calling render() directly. The redirect means that the request is ended and replication could happen. However, I'm not sure if things will still work if I remove FacesContext from the session and immediately rebuild it during render().

          BTW, as part of the cleanup I've now added FacesContext.release() at the end of the render() phase.

          Show
          Stan Silvert added a comment - I occurs to me that the FacesContext also needs to be removed from the session at the end of processAction. I have learned that some Portal containers actually do a redirect after processAction instead of calling render() directly. The redirect means that the request is ended and replication could happen. However, I'm not sure if things will still work if I remove FacesContext from the session and immediately rebuild it during render(). BTW, as part of the cleanup I've now added FacesContext.release() at the end of the render() phase.
          Show
          Wendy Smoak added a comment - http://svn.apache.org/viewvc?view=rev&rev=473527 http://svn.apache.org/viewvc?view=rev&rev=473555 http://svn.apache.org/viewvc?view=rev&rev=485877
          Hide
          Wendy Smoak added a comment -

          updated component and versions

          Show
          Wendy Smoak added a comment - updated component and versions
          Hide
          Manfred Geiler added a comment -

          Stan, this one is fixed for 1.1.5, right?

          Show
          Manfred Geiler added a comment - Stan, this one is fixed for 1.1.5, right?
          Hide
          Stan Silvert added a comment -

          Yes, it's fixed in 1.1.5. Though I doubt that this is the last of the clustering issues with JSF portlets. More research is needed.

          Show
          Stan Silvert added a comment - Yes, it's fixed in 1.1.5. Though I doubt that this is the last of the clustering issues with JSF portlets. More research is needed.

            People

            • Assignee:
              Stan Silvert
              Reporter:
              John Gilbert
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development