Details
-
Bug
-
Resolution: Done
-
Minor
-
1.1.0.Beta1
-
None
-
Compatibility/Configuration
-
Low
Description
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)
}