I replaced the above line of code with the code below and It works fine :) I was not having acesss to FacesContext which was throwing a Null Pointer
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext == null) {
FacesContextFactory contextFactory =
(FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
LifecycleFactory lifecycleFactory =
(LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
Lifecycle lifecycle =
lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
facesContext =
contextFactory.getFacesContext(request.getSession().getServletContext(),
request, response,
lifecycle);
// Below is an Inner Class which extends FacesContext to use its below protected method
AbstractInnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
}
Now Since I have FacesContext I can easily retrive SessionContext from this using the same logic used by resolveExpression Method :) (Yay!!!)