[ 
http://www.stripesframework.org/jira/browse/STS-529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Gunter resolved STS-529.
----------------------------

    Resolution: Fixed

This is an odd one indeed, and it requires more specific circumstances than 
merely redirecting to an unregistered ActionBean class. I didn't figure out 
exactly how to reproduce it, but I did take the following steps to prevent the 
odd NPE you're seeing.

To avoid NPEs when looking for event handlers for ActionBean classes that are 
unknown to the ActionResolver, the map that holds the event mappings returns an 
empty map instead of null for any key that is not present in the map. In the 
end, the user will get a more informative message that says the default handler 
can't be located instead of an obscure NPE.

Please test this out and let me know if it doesn't help the situation.

> Redirecting to unregistered action beans yields NPE in 
> AnnotatedClassActionResolver
> -----------------------------------------------------------------------------------
>
>                 Key: STS-529
>                 URL: http://www.stripesframework.org/jira/browse/STS-529
>             Project: Stripes
>          Issue Type: Improvement
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5
>            Reporter: Levi Hoogenberg
>            Priority: Minor
>             Fix For: Release 1.5
>
>
> When using the RedirectResolution(Class<? extends ActionBean>) constructor, 
> the redirect fails if the action bean class was not registered with the 
> action resolver (i.e. it's not inside a package declared with the 
> ActionResolver.Packages configuration property). The same probably goes for 
> the other onward resolutions. The relevant part of the stack trace is
> java.lang.NullPointerException
>     at 
> net.sourceforge.stripes.controller.AnnotatedClassActionResolver.getEventNameFromRequestParams(AnnotatedClassActionResolver.java:445)
>     at 
> net.sourceforge.stripes.controller.AnnotatedClassActionResolver.getEventName(AnnotatedClassActionResolver.java:408)
>     ...
> Of course, the user is to blame when he fails to put action bean classes 
> where he told Stripes he would put them, but the stack trace can be quite 
> confusing. Especially if the first normal requests works as the 
> DefaultViewActionBean kicks in :)

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

        

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to