[weld-issues] [JBoss JIRA] Closed: (WELD-730) WeldApplication shouldn't assume FacesContext is available when attempting lazy initialization

Pete Muir (JIRA) jira-events at lists.jboss.org
Mon Nov 8 15:19:25 EST 2010


     [ https://jira.jboss.org/browse/WELD-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pete Muir closed WELD-730.
--------------------------



> WeldApplication shouldn't assume FacesContext is available when attempting lazy initialization
> ----------------------------------------------------------------------------------------------
>
>                 Key: WELD-730
>                 URL: https://jira.jboss.org/browse/WELD-730
>             Project: Weld
>          Issue Type: Bug
>          Components: Servlet Container Support
>    Affects Versions: 1.1.0.Beta1
>            Reporter: Dan Allen
>            Assignee: Dan Allen
>            Priority: Minor
>             Fix For: 1.1.0.CR1
>
>
> WeldApplication uses a forwarding wrapper around the delegate JSF Application object in order to get around the fact that BeanManager may not have been initialized at the time JSF is initializing. However, it assumes that the first use of Application will be during a faces request, where FacesContext is available. However, the JSF Application object is permitted to be accessed outside of the faces lifecycle (such as in a Servlet filter). When this occurs, a NullPointerException in WeldApplication results.
> WeldApplication should skip the BeanManager lookup if the FacesContext is null.
> private BeanManager beanManager()
> {
>    FacesContext facesContext;
>    if (beanManager != null && (facesContext = FacesContext.getCurrentInstance()) != null) {
>       // lookup BeanManager
>    }
> }

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

        


More information about the weld-issues mailing list