You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2009/03/26 11:48:07 UTC

[jira] Commented: (SLING-868) NPE in SlingAuthenticator.findApplicableAuthenticationHandler

    [ https://issues.apache.org/jira/browse/SLING-868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689437#action_12689437 ] 

Alexander Klimetschek commented on SLING-868:
---------------------------------------------

If no authentication handlers are available (yet), getAuthenticationHandlers() returns an empty map (EMPTY_PROTOCOL_MAP). But the fallback inside findApplicableAuthenticationHandlers() - if the correct authentication handler is not found - is to use byProtocolMap.get("") which also returns null for the empty map. Hence you get an NPE with byHostMap.get(hostname) in line 349.



> NPE in SlingAuthenticator.findApplicableAuthenticationHandler
> -------------------------------------------------------------
>
>                 Key: SLING-868
>                 URL: https://issues.apache.org/jira/browse/SLING-868
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> Running the launchpad/testing tests in revision 746969 I get this stack trace a few times:
> 2009-02-23 13:00:22.294::WARN:  /org.apache.sling.launchpad.testing-4-incubator-SNAPSHOT/WaitForSlingStartup/1235390422271: 
> java.lang.NullPointerException
>         at org.apache.sling.engine.impl.auth.SlingAuthenticator.findApplicableAuthenticationHandlers(SlingAuthenticator.java:349)
>         at org.apache.sling.engine.impl.auth.SlingAuthenticator.getAuthenticationInfo(SlingAuthenticator.java:468)
>         at org.apache.sling.engine.impl.auth.SlingAuthenticator.authenticate(SlingAuthenticator.java:204)
>         at org.apache.sling.engine.impl.SlingMainServlet.handleSecurity(SlingMainServlet.java:794)
>         at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:86)
> Line 349 is
>   AuthenticationHandlerInfo[] infos = byHostMap.get(hostname);
> so I assume it's byHostMap that can be null in some cases

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.