[Yanel-dev] Strange NullPointer

basZero baszero at gmail.com
Tue Sep 20 18:27:00 CEST 2011


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> 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/7230ebbc/attachment.html>


More information about the Yanel-development mailing list