[ 
http://issues.apache.org/jira/browse/COCOON-1772?page=comments#action_12375540 
] 

Carsten Ziegeler commented on COCOON-1772:
------------------------------------------

I think the code is correct (more or less - it would be better to throw a 
different exception as an NPE of course): Could it be, that you are storing the 
authentication context between requests and are accessing the context in a sub 
sequent request?
You should request a new authentication context within each request (this might 
not be documented though...) and only use this instance during this request.
Another possibility for this NPE might be that you are not authenticated for 
the current request, which means that the auth-protect action has not been 
invoked.

> [PATCH] AuthenticationContext: NullPointerException
> ---------------------------------------------------
>
>          Key: COCOON-1772
>          URL: http://issues.apache.org/jira/browse/COCOON-1772
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Authentication Framework
>     Versions: 2.1.8
>     Reporter: Antonio Fiol
>     Assignee: Carsten Ziegeler
>  Attachments: AuthenticationContext.java.patch, 
> AuthenticationContext.java.patch
>
> We got a NullPointerException on AuthenticationContext.
> Apparently, this.getState() is returning null.
> We did not investigate it any further, and supposed that a null RequestState 
> means a null applicationName, which is reasonable as we have no "application" 
> configured.
> Patched, and it works perfectly here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to