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

                 Key: WICKET-3918
                 URL: https://issues.apache.org/jira/browse/WICKET-3918
             Project: Wicket
          Issue Type: Bug
          Components: wicket-core
    Affects Versions: 1.5-RC5.1
            Reporter: Martijn Dashorst


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?



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to