Wicket
  1. Wicket
  2. WICKET-3918

NPE when requesting http://example.com/app/wicket/resource/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC5.1
    • Fix Version/s: 1.5-RC6
    • Component/s: wicket
    • Labels:
      None

      Description

      When requesting the following URL, the default caching strategy throws a NullPointerException and this is logged. This request is performed by some spider agent of Microsoft (trying to kill Wicket!) with user agent 'Microsoft Office Protocol Discovery':

      Url=http://example.com/app/wicket/resource/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/

      java.lang.NullPointerException: caching strategy must not return an empty filename
      at org.apache.wicket.request.mapper.BasicResourceReferenceMapper.mapRequest(BasicResourceReferenceMapper.java:102)
      at org.apache.wicket.request.mapper.ParentPathReferenceRewriter.mapRequest(ParentPathReferenceRewriter.java:83)
      at org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:129)
      at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:183)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:208)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216)

      A couple of points:

      • the exception should log which strategy caused the empty filename
      • the exception might want to log the requested URL for the resource
      • perhaps a NullPointerException is not the best exception to throw, but rather something that results in a 404 or a 403
      • maybe not even throwing an exception is the best way to handle this case, instead rely on the container or another mapper to take the lead?

        Activity

          People

          • Assignee:
            Martijn Dashorst
            Reporter:
            Martijn Dashorst
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development