ICEfaces
  1. ICEfaces
  2. ICE-4135

ViewDisposal code can't assume servlet environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8RC1
    • Fix Version/s: 1.8RC2, 1.8
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces + portlets

      Description

      Some code recently added to the dispose() method in View.java assumes a Servlet environment and throws an exception when running in a portal environment.

        Activity

        Hide
        Greg Dick added a comment - - edited

        public void dispose()

        { dispose.run(); --> ContextEventRepeater.viewNumberDisposed( (HttpSession)facesContext.getExternalContext().getSession(false), sessionID, Integer.parseInt(viewIdentifier)); }

        This throws a ClassCastException with the following line:
        ERROR - java.lang.ClassCastException: com.icesoft.faces.webapp.http.portlet.InterceptingPortletSession -

        Show
        Greg Dick added a comment - - edited public void dispose() { dispose.run(); --> ContextEventRepeater.viewNumberDisposed( (HttpSession)facesContext.getExternalContext().getSession(false), sessionID, Integer.parseInt(viewIdentifier)); } This throws a ClassCastException with the following line: ERROR - java.lang.ClassCastException: com.icesoft.faces.webapp.http.portlet.InterceptingPortletSession -
        Hide
        Jack Van Ooststroom added a comment -

        Changed Fix Version(s) to 1.8.0

        Show
        Jack Van Ooststroom added a comment - Changed Fix Version(s) to 1.8.0
        Hide
        Jack Van Ooststroom added a comment -

        This is caused by the fix to ICE-3014

        Show
        Jack Van Ooststroom added a comment - This is caused by the fix to ICE-3014
        Hide
        Jack Van Ooststroom added a comment -

        I changed some various APIs for this. Instead of storing the source as an HttpSession, it is now stored as an Object. This way the PortletSession can be stored as well. The HttpSession's API was never explicitly used any ways and the superclass EventObject was storing it as an Object anyhow.

        ContextEventRepeater:

        public synchronized static void iceFacesIdDisposed(final Object source, final String iceFacesId)

        public synchronized static void iceFacesIdRetrieved(final Object source, final String iceFacesId)

        public synchronized static void viewNumberDisposed(final Object source, final String iceFacesId, final int viewNumber)

        public synchronized static void viewNumberRetrieved(final Object source, final String iceFacesId, final int viewNumber)

        ICEfacesIDDisposedEvent:

        public ICEfacesIDDisposedEvent(final Object source, final String iceFacesId)

        ICEfacesIDRetrievedEvent:

        public ICEfacesIDRetrievedEvent(final Object source, final String iceFacesId)

        ViewNumberDisposedEvent:

        public ViewNumberDisposedEvent(final Object source, final String iceFacesId, final int viewNumber)

        ViewNumberRetrievedEvent:

        public ViewNumberRetrievedEvent(final Object source, final String iceFacesId, final int viewNumber)

        AbstractSessionEvent:

        public Object getSession()

        Show
        Jack Van Ooststroom added a comment - I changed some various APIs for this. Instead of storing the source as an HttpSession, it is now stored as an Object. This way the PortletSession can be stored as well. The HttpSession's API was never explicitly used any ways and the superclass EventObject was storing it as an Object anyhow. ContextEventRepeater: public synchronized static void iceFacesIdDisposed(final Object source, final String iceFacesId) public synchronized static void iceFacesIdRetrieved(final Object source, final String iceFacesId) public synchronized static void viewNumberDisposed(final Object source, final String iceFacesId, final int viewNumber) public synchronized static void viewNumberRetrieved(final Object source, final String iceFacesId, final int viewNumber) ICEfacesIDDisposedEvent: public ICEfacesIDDisposedEvent(final Object source, final String iceFacesId) ICEfacesIDRetrievedEvent: public ICEfacesIDRetrievedEvent(final Object source, final String iceFacesId) ViewNumberDisposedEvent: public ViewNumberDisposedEvent(final Object source, final String iceFacesId, final int viewNumber) ViewNumberRetrievedEvent: public ViewNumberRetrievedEvent(final Object source, final String iceFacesId, final int viewNumber) AbstractSessionEvent: public Object getSession()
        Hide
        Jack Van Ooststroom added a comment -

        With the introduction of Push Server, this got resolved. Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - With the introduction of Push Server, this got resolved. Marking this one as FIXED.

          People

          • Assignee:
            Unassigned
            Reporter:
            Greg Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: