ICEfaces
  1. ICEfaces
  2. ICE-9373

Chat application throws NPE when session expires and user is logged out

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3, EE-3.3.0.GA
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      Chat sample app
    • Assignee Priority:
      P3
    • Affects:
      Sample App./Tutorial

      Description

      The chat sample supports internationalizing messages but tries to use the FacesContext to determine the Locale during logout:

          public static String getLocalizedMessage(String messagePatternKey, String[] messageArgs){
              FacesContext facesContext = FacesContext.getCurrentInstance();
              UIViewRoot root = facesContext.getViewRoot();
              Locale locale = root.getLocale();
              String localizedPattern = ResourceUtil.getI18NString(locale,messagePatternKey);
              return MessageFormat.format(localizedPattern,(Object[])messageArgs);
          }

      When a session expires, the container thread does not have a FacesContext leading to the NPE. We need to check for FacesContext in this case and just use the default locale.

        Activity

        Deryk Sinotte created issue -
        Deryk Sinotte made changes -
        Field Original Value New Value
        Assignee Deryk Sinotte [ deryk.sinotte ]
        Priority Major [ 3 ] Minor [ 4 ]
        Assignee Priority P3 [ 10012 ]
        Deryk Sinotte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Affects Sample App./Tutorial [ 10001 ]
        Fix Version/s 3.4 [ 10770 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: