You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2009/02/23 16:24:02 UTC

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

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.


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

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-868:
-----------------------------------

    Affects Version/s: Engine 2.0.4
        Fix Version/s: Engine 2.0.4

> NPE in SlingAuthenticator.findApplicableAuthenticationHandler
> -------------------------------------------------------------
>
>                 Key: SLING-868
>                 URL: https://issues.apache.org/jira/browse/SLING-868
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.0.4
>            Reporter: Bertrand Delacretaz
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Engine 2.0.4
>
>
> 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.


[jira] Issue Comment Edited: (SLING-868) NPE in SlingAuthenticator.findApplicableAuthenticationHandler

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689437#action_12689437 ] 

Alexander Klimetschek edited comment on SLING-868 at 3/26/09 3:49 AM:
----------------------------------------------------------------------

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.

I think the NPE should be avoided and replaced by a warning like "No authentication handler found, using anonymous login".

      was (Author: alexander.klimetschek):
    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.


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

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reassigned SLING-868:
--------------------------------------

    Assignee: Carsten Ziegeler

> 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
>            Assignee: Carsten Ziegeler
>            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.


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

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-868.
----------------------------------

    Resolution: Fixed

I've added extra code to prevent the NPE in Revision: 766012.

> 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
>            Assignee: Carsten Ziegeler
>            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.


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

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ 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.