ICEpush
  1. ICEpush
  2. PUSH-212

java.lang.NumberFormatException in BlockingConnectionServer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.2.0.BETA
    • Fix Version/s: EE-3.2.0.GA
    • Component/s: Push Library
    • Labels:
      None
    • Environment:
      ICEmobile

      Description

      If an iOS client connects with an undefined apns ID (such as a development version of ICEmobile-SX) the following Exception is seen:

      Caused by: java.lang.NumberFormatException: null
      at java.lang.Integer.parseInt(Integer.java:417)
      at java.lang.Integer.parseInt(Integer.java:499)
      at org.icepush.servlet.ServletRequestResponse.getHeaderAsInteger(ServletRequestResponse.java:125)
      at org.icepush.http.standard.RequestProxy.getHeaderAsInteger(RequestProxy.java:65)
      at org.icepush.http.standard.RequestProxy.getHeaderAsInteger(RequestProxy.java:65)
      at org.icepush.BlockingConnectionServer$RunningServer.service(BlockingConnectionServer.java:301)
      at org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:98)
      at org.icepush.SequenceTaggingServer.service(SequenceTaggingServer.java:20)
      at com.icesoft.icepush.AdjustHeartbeatServer.service(AdjustHeartbeatServer.java:32)
      at org.icepush.ConfigurationServer.service(ConfigurationServer.java:92)
      at org.icepush.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:45)
      at org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:48)
      at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:39)
      at org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:117)
      at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:45)
      at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:39)
      at org.icepush.servlet.MainServlet.service(MainServlet.java:116)
      at org.icefaces.impl.push.servlet.ICEpushResourceHandler$ICEpushResourceHandlerImpl.handleResourceRequest(ICEpushResourceHandler.java:232)

        Activity

        Hide
        Ted Goddard added a comment -

        My analysis doesn't seem correct:

        pushGroupManager.recordListen(participatingPushIDs, request.getHeaderAsInteger("ice.push.sequence"));

        is trying to pick up the ice.push.sequence which hasn't been defined yet.

        Show
        Ted Goddard added a comment - My analysis doesn't seem correct: pushGroupManager.recordListen(participatingPushIDs, request.getHeaderAsInteger("ice.push.sequence")); is trying to pick up the ice.push.sequence which hasn't been defined yet.
        Hide
        Deryk Sinotte added a comment - - edited

        I was seeing this with portlet testing with push as well (both EE and non-EE apps).

        Caused by: java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:417)
        at java.lang.Integer.parseInt(Integer.java:499)
        at org.icepush.servlet.ServletRequestResponse.getHeaderAsInteger(ServletRequestResponse.java:126)
        at org.icepush.http.standard.RequestProxy.getHeaderAsInteger(RequestProxy.java:65)
        at org.icepush.BlockingConnectionServer$RunningServer.service(BlockingConnectionServer.java:300)
        at org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:98)
        at org.icepush.SequenceTaggingServer.service(SequenceTaggingServer.java:36)
        at org.icepush.ConfigurationServer.service(ConfigurationServer.java:92)
        at org.icepush.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:45)
        at org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:48)
        at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:39)
        at org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:117)
        at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:45)
        at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:39)
        at org.icepush.servlet.MainServlet.service(MainServlet.java:116)
        at org.icefaces.impl.push.servlet.ICEpushResourceHandler$ICEpushResourceHandlerImpl.handleResourceRequest(ICEpushResourceHandler.java:219)

        I added some logging to the last method:

        ServletRequestResponse.getHeaderAsInteger: asking for ice.push.sequence got null from org.icefaces.impl.push.servlet.ProxyHttpServletRequest@fa1567b

        Seems we just need to guard against/log a warning/etc when "ice.push.sequence" isn't available.

        I did notice that in SequenceTaggingServer we do guard against it:

        try {
            previousSequenceNo = request.getHeaderAsInteger("ice.push.sequence");
        } catch (RuntimeException e) {
            previousSequenceNo = 0;
        }
        
        Show
        Deryk Sinotte added a comment - - edited I was seeing this with portlet testing with push as well (both EE and non-EE apps). Caused by: java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:417) at java.lang.Integer.parseInt(Integer.java:499) at org.icepush.servlet.ServletRequestResponse.getHeaderAsInteger(ServletRequestResponse.java:126) at org.icepush.http.standard.RequestProxy.getHeaderAsInteger(RequestProxy.java:65) at org.icepush.BlockingConnectionServer$RunningServer.service(BlockingConnectionServer.java:300) at org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:98) at org.icepush.SequenceTaggingServer.service(SequenceTaggingServer.java:36) at org.icepush.ConfigurationServer.service(ConfigurationServer.java:92) at org.icepush.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:45) at org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:48) at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:39) at org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:117) at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:45) at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:39) at org.icepush.servlet.MainServlet.service(MainServlet.java:116) at org.icefaces.impl.push.servlet.ICEpushResourceHandler$ICEpushResourceHandlerImpl.handleResourceRequest(ICEpushResourceHandler.java:219) I added some logging to the last method: ServletRequestResponse.getHeaderAsInteger: asking for ice.push.sequence got null from org.icefaces.impl.push.servlet.ProxyHttpServletRequest@fa1567b Seems we just need to guard against/log a warning/etc when "ice.push.sequence" isn't available. I did notice that in SequenceTaggingServer we do guard against it: try { previousSequenceNo = request.getHeaderAsInteger( "ice.push.sequence" ); } catch (RuntimeException e) { previousSequenceNo = 0; }
        Hide
        Jack Van Ooststroom added a comment -

        Sending core/src/main/java/org/icepush/BlockingConnectionServer.java
        Transmitting file data .
        Committed revision 33110.

        Show
        Jack Van Ooststroom added a comment - Sending core/src/main/java/org/icepush/BlockingConnectionServer.java Transmitting file data . Committed revision 33110.
        Hide
        Jack Van Ooststroom added a comment -

        Added the similar check to BlockingConnectionServer. It looks like it's okay to set the sequenceNumber to 0 upon RuntimeException, which includes NumberFormatException). Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - Added the similar check to BlockingConnectionServer. It looks like it's okay to set the sequenceNumber to 0 upon RuntimeException, which includes NumberFormatException). Marking this one as FIXED.

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: