ICEfaces
  1. ICEfaces
  2. ICE-7698

NullPointerException in DOMUtils

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.RC2
    • Fix Version/s: 3.0.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      probably all environments
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Check that val is not null, i.e. change the isWhitespaceText()-Method to:

          private static boolean isWhitespaceText(Node node) {
              if (node.getNodeType() == Node.TEXT_NODE) {
                  String val = node.getNodeValue();
                  if (val != null) {
                      // Treat an empty string like whitespace
                      for (int i = val.length() - 1; i >= 0; i--) {
                          if (!Character.isWhitespace(val.charAt(i))) {
                              return false;
                          }
                      }
                      return true;
                  }
              }
              return false;
          }
      Show
      Check that val is not null, i.e. change the isWhitespaceText()-Method to:     private static boolean isWhitespaceText(Node node) {         if (node.getNodeType() == Node.TEXT_NODE) {             String val = node.getNodeValue();             if (val != null) {                 // Treat an empty string like whitespace                 for (int i = val.length() - 1; i >= 0; i--) {                     if (!Character.isWhitespace(val.charAt(i))) {                         return false;                     }                 }                 return true;             }         }         return false;     }

      Description

      When using ICEFaces together with Spring Webflow, a NullPointerException may arise at org.icefaces.impl.util.DOMUtils.isWhitespaceText(DOMUtils.java:341)

        Activity

        Andreas Peer created issue -
        Hide
        Greg Dick added a comment -

        There is a known solution to this problem. The problem occurs in the Spring Webflow POST-REDIRECT-GET navigation pattern that does not fire the BridgeSetup PhaseListener in the subsequent GET, so it appears that vital view and window IDs are not part of the request. The solution is an implmentation of FlowExecutionListenerAdapter that does the same work on resumption of the Webflow.

        This isn't part of the ICEFaces release code, for obvious build and dependency issues, but an example implementation can be found with the ICEfaces 3.0.1 + Spring Webflow 2.3.1 tutorial.

        Show
        Greg Dick added a comment - There is a known solution to this problem. The problem occurs in the Spring Webflow POST-REDIRECT-GET navigation pattern that does not fire the BridgeSetup PhaseListener in the subsequent GET, so it appears that vital view and window IDs are not part of the request. The solution is an implmentation of FlowExecutionListenerAdapter that does the same work on resumption of the Webflow. This isn't part of the ICEFaces release code, for obvious build and dependency issues, but an example implementation can be found with the ICEfaces 3.0.1 + Spring Webflow 2.3.1 tutorial.
        Greg Dick made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 3.0.1 [ 10282 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Andreas Peer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: