I've tried updating a local copy of the ICEfaces source with this, and I'm still getting the NullPointerException. I added some calls to system.out to see what was going on....
public void navigateTo(String outcome) {
warnIfSynchronous();
try {
BridgeFacesContext facesContext = view.getFacesContext();
FacesContext fc = FacesContext.getCurrentInstance();
System.out.println("fc = " + fc);
if (fc != null)
{
System.out.println("fc.getViewRoot() = " + fc.getViewRoot());
}
// #4251 start a lifecycle to re-establish the ViewRoot before
// trying navigation if a lifecycle is not already running
if (fc == null)
{
execute();
}
facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, facesContext.getViewRoot().getViewId(), outcome);
if (fc == null)
{
render();
}
} catch (Exception e)
{
throw new RuntimeException(e);
}
}
When I look at the system log, I'm getting
core render service created:
core pool size : 10
max pool size : 15
keep alive time: 300000
fc = com.icesoft.faces.context.BridgeFacesContext@19b7f7f
fc.getViewRoot() = null
So this isn't working in my instance.
If I change the check to
if ((fc == null) || (fc.getViewRoot() == null)) {
It never completes (so the navigation never works).
From what I'm seeing, the BridgeFacesContext never goes away.
I've found a way to check if a lifecycle is currently in process and to start a lifecycle if not. This seems to work well.
/**
*
*
*/
public void navigateTo(String outcome) {
warnIfSynchronous();
try
catch (Exception e)
{ throw new RuntimeException(e); }}
I've removed the threadLocal management code in this method since it already is in place in the execute and render
methods.