Uploaded image for project: '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/

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-RC5.1
    • 1.5-RC6
    • wicket
    • 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?

      Attachments

        Activity

          People

            dashorst Martijn Dashorst
            dashorst Martijn Dashorst
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: