[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-4032) Page scope throws exception when setting null value

Matthew Lieder (JIRA) jira-events at lists.jboss.org
Thu Mar 26 17:44:34 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBSEAM-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12459307#action_12459307 ] 

Matthew Lieder commented on JBSEAM-4032:
----------------------------------------

Thanks Norman, that's perfect. BTW, it looks like your commit included some debug code:

    1438 +       if (name.equals("slowpoke")) { 
    1439 +           System.out.println("!instantiate " + name); 
    1440 +       } 


> Page scope throws exception when setting null value
> ---------------------------------------------------
>
>                 Key: JBSEAM-4032
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4032
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1.GA
>            Reporter: Matthew Lieder
>            Assignee: Norman Richards
>             Fix For: 2.1.2.CR1
>
>
> The following code will cause an unhelpful NPE to be thrown by JSF when the factory is accessed:
> @Name("someComponent")
> @Scope(ScopeType.PAGE)
> public class SomeComponent implements Serializable {
> @Factory("someVar")
> public String getSomeVar() {
> return null;
> }
> }
> While I believe I remember reading that using that particular type of factory method on a page-scoped component isn't supported (supported by the fact that removing the @Scope makes it work), the exception should at least be somewhat helpful in debugging the problem. NPE's with no messages are about as unfriendly as one can get.

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

        



More information about the seam-issues mailing list