NPE in SlingServletResolver.resolveServlet() for no matches if debug logging 
enabled
------------------------------------------------------------------------------------

                 Key: SLING-2099
                 URL: https://issues.apache.org/jira/browse/SLING-2099
             Project: Sling
          Issue Type: Bug
          Components: Servlets
    Affects Versions: Servlets Resolver 2.1.0
            Reporter: Alexander Klimetschek
            Priority: Minor


Steps to reproduce:
- enable debug logging for org.apache.sling.servlets.resolver
- call SlingServletResolver.resolveServlet(rr, "doesnotexist.jsp")

=> results in this stacktrace:
Caused by: java.lang.NullPointerException
        at 
org.apache.sling.api.request.RequestUtil.getServletName(RequestUtil.java:129)
        at 
org.apache.sling.servlets.resolver.internal.SlingServletResolver.resolveServlet(SlingServletResolver.java:360)
        at 
org.apache.sling.servlets.resolver.internal.SlingServletResolver.resolveServlet(SlingServletResolver.java:320)

The problem is in the internal resolveServlet(), where in the servlet == null 
and log.isDebugEnabled() case, RequestUtil.getServletName(servlet) is called, 
which throws for a null argument.

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

Reply via email to