[Yanel-dev] Strange NullPointer
Michael Wechner
michael.wechner at wyona.com
Tue Sep 20 23:43:01 CEST 2011
Hi Balz
I agree. Please give it a try with
Sending
src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
Transmitting file data .
Committed revision 60816.
HTH
Michael
On 9/20/11 6:27 PM, basZero wrote:
> maybe a hint:
> where does the "identity" come from? how is it built?
> because:
> - at 3pm today i logged in with user A to our test system (cookies
> have been set in browser)
> - later I deployed a new version, from then on, the user A does not
> exist anymore in the new version (this is on purpose).
> - When I access the test system, the cookie is sent of course
> (containing the username A which does not exist anymore). Somehow, the
> system throws the NullPointer.
>
> My opinion is: the NullPointer should not be thrown, because the
> following "more legal" use case could happen easily:
>
> 1. user A registers and logs in
> 2. a sysadmin deletes for any reason user A
> 3. user A comes back to the site.... boooom.
>
> Cheers
> Balz
>
> On Tue, Sep 20, 2011 at 6:19 PM, basZero <baszero at gmail.com
> <mailto:baszero at gmail.com>> wrote:
>
> Hi Michael,
> I've noticed a change in the BasicXMLResource, now my new version
> based on *r60815* is throwing a NullPointer exception while
> accessing any page of the realm.
>
> 2903 2011-09-20 18:08:34,671 [http-8380-1] ERROR
> org.wyona.yanel.impl.resources.BasicXMLResource.getXMLView():279
> - java.lang.NullPointerException
> java.lang.NullPointerException
> at
> org.wyona.yanel.impl.resources.BasicXMLResource.getUserLanguage(BasicXMLResource.java:682)
>
>
> *New code* in BasicXMLResource:
>
> String userID = identity.getUsername();
>
> if (userID != null) {
>
> String userLanguage =
> getRealm().getIdentityManager().getUserManager().getUser(userID).getLanguage();
>
>
> Cheers
> Balz
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wyona.org/pipermail/yanel-development/attachments/20110920/27cf7145/attachment.html>
More information about the Yanel-development
mailing list