FacesContext.getCurrentInstance() returns null in Runnable class

The FacesContext is stored as a ThreadLocal variable in the thread responsible for the HTTP request which invoked the FacesServlet, the one responsible for creating the FacesContext. This thread usually goes through the JSF managed bean methods only. The FacesContext is not available in other threads spawned by that thread. You should actually also not … Read more

java.lang.RuntimeException Cannot find FacesContext

java.lang.RuntimeException: Cannot find FacesContext Thus, the JSF <f:xxx> and <h:xxx> tags are complaining that FacesContext cannot be found. The FacesServlet is the one responsible for creating the faces context. The faces servlet is invoked when the request URL matches its URL pattern, which is in your particular case *.jsf. So, when you open the index.jsp … Read more