Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5009

Method AbstractRequestLogger.hasBufferRolledOver does not handle situation where requestWindow is a zero-length array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 6.4.0
    • None
    • wicket

    Description

      [2013-01-25 18:05:55,378] [ERROR] [ajp-bio-8019-exec-58] org.apache.wicket.request.cycle.RequestCycle | Exception occurred during onEndRequest
      java.lang.ArrayIndexOutOfBoundsException: -1
      at org.apache.wicket.protocol.http.AbstractRequestLogger.hasBufferRolledOver(AbstractRequestLogger.java:185)
      at org.apache.wicket.protocol.http.AbstractRequestLogger.resizeBuffer(AbstractRequestLogger.java:448)
      at org.apache.wicket.protocol.http.AbstractRequestLogger.addRequest(AbstractRequestLogger.java:339)
      at org.apache.wicket.protocol.http.CobraRequestLogger.addRequest(CobraRequestLogger.java:40)
      at org.apache.wicket.protocol.http.AbstractRequestLogger.requestTime(AbstractRequestLogger.java:246)
      at org.apache.wicket.Application$2.onEndRequest(Application.java:1640)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection$2.notify(RequestCycleListenerCollection.java:85)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection$2.notify(RequestCycleListenerCollection.java:81)
      at org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:144)
      at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onEndRequest(RequestCycleListenerCollection.java:80)
      at org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:606)
      at org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:568)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:286)
      at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:267)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

      Check for zero-length array is after the call to resizeBuffer() in the method addRequest:
      // if the requestWindow is a zero-length array, nothing gets stored
      if (requestWindow.length == 0)
      return;

      The reason why the requestWindow array was initialized with length 0 at all is still something I am looking into, but the exception in hasBufferRolledOver prevents the resizeBuffer method to lazy init the array at a later moment.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              boschman Sverre Boschman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: