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

        Hide
        Deryk Sinotte added a comment -

        Marking as fixed. Now checking for instance of FacesContext during logout and, if null, use default Locale.

        Show
        Deryk Sinotte added a comment - Marking as fixed. Now checking for instance of FacesContext during logout and, if null, use default Locale.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: