ICEfaces
  1. ICEfaces
  2. ICE-2410

occasional NullPointerException with WebMC on GlassFish

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#2
    • Fix Version/s: 1.7.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      ICEfaces, glassfish-v2-ur1-b08
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      + uri = URI.create("http://" + req.getServerName() + ":"
      + + req.getServerPort() + req.getRequestURI());

      Show
      + uri = URI.create("http://" + req.getServerName() + ":" + + req.getServerPort() + req.getRequestURI());

      Description


      GlassFish/Grizzly integration is now working well with the auctionMonitor, however occasional NullPointerExeptions were seen with WebMC. The following workaround and debugging code was applied for this. The NullPointerException is due to the getScheme() returning null on the request. A current version of GlassFish must be tested with WebMC to verify this.



      +++ src/com/icesoft/faces/webapp/http/servlet/ServletRequestResponse.java (working copy)
      @@ -45,7 +45,18 @@
                   public void servlet(Object request, Object response) {
                       HttpServletRequest req = (HttpServletRequest) request;
                       String query = req.getQueryString();
      - URI uri = URI.create(req.getRequestURL().toString());
      + URI uri = null;
      + try {
      + uri = URI.create(req.getRequestURL().toString());
      + } catch (Exception e) {
      + System.out.println("building our own URI " + e);
      + uri = URI.create("http://" + req.getServerName() + ":"
      + + req.getServerPort() + req.getRequestURI());
      + System.out.println("Constructing URI " + uri + " scheme " + req.getScheme());
      + }
      + }
                       requestURI = (query == null ? uri : URI.create(uri + "?" + query));
                   }

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: