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

Dan Allen (JIRA) jira-events at lists.jboss.org
Fri Oct 15 19:18:39 EDT 2010


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

Dan Allen updated WELD-730:
---------------------------

    Summary: WeldApplication shouldn't assume FacesContext is available when attempting lazy initialization  (was: WeldApplication should not assume FacesContext is available during lazy initialization)


> 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
>             Fix For: 1.1.0.Beta2
>
>
> 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