Re: Facelets: Back button, then nav-link click produces NPE

2012-07-17 Thread Scott O'Bryan
Yeah I think we just got a bug logged on this.  I'll try to have someone
take a look.

On Fri, Jul 6, 2012 at 7:12 AM, Leonardo Uribe  wrote:

> Hi
>
> The line number does not match with the latest code of ApplicationImpl.
> But the code that throws the NullPointerException is this:
>
> private static SystemEvent _traverseListenerList(List SystemEventListener> listeners,
>  Class SystemEvent> systemEventClass, Object source,
>  SystemEvent event)
> {
> if (listeners != null && !listeners.isEmpty())
> {
> // perf: org.apache.myfaces.application.ApplicationImpl.
> //
>  SystemListenerEntry.getSpecificSourceListenersNotNull(Class)
> // or javax.faces.component.UIComponent.subscribeToEvent(
> //  Class,
> ComponentSystemEventListener)
> // creates a ArrayList:
> for (int i  = 0, size = listeners.size(); i < size; i++)
> {
> SystemEventListener listener = listeners.get(i);
> // Call
> SystemEventListener.isListenerForSource(java.lang.Object), passing the
> source argument.
> // If this returns false, take no action on the listener.
> if (listener.isListenerForSource(source))
> {
> // Otherwise, if the event to be passed to the
> listener instances has not yet been constructed,
> // construct the event, passing source as the argument
> to the one-argument constructor that takes
> // an Object. This same event instance must be passed
> to all listener instances.
> event = _createEvent(systemEventClass, source, event);
>
> // Call
> SystemEvent.isAppropriateListener(javax.faces.event.FacesListener), passing
> the listener
> // instance as the argument. If this returns false,
> take no action on the listener.
> if (event.isAppropriateListener(listener))
> {
> // Call
> SystemEvent.processListener(javax.faces.event.FacesListener), passing the
> listener
> // instance.
> event.processListener(listener);
> }
> }
> }
> }
>
> return event;
> }
>
> There is only one choice: list of listeners has some null elements, which
> is invalid. But maybe it could be solved just adding a null check:
>
> if (listener != null &&
> listener.isListenerForSource(source))
>
> In theory it should not happen, the code in MyFaces is correct, but the
> null check is harmless. Anyway, the question is why Trinidad returns a
> listener list with null values?. It could be a bug into trinidad state
> saving algorithm, but without a tests sounds very difficult to solve,
> because only occur in a non frequent use case.
>
> regards,
>
> Leonardo Uribe
>
> 2012/7/4 jnthodge :
>
> >
> > OK, we've upgraded to 2.1.7 as you suggested, and it has only changed the
> > line number that throws this error in ApplicationImpl.java.  Any
> thoughts?
> >
> > Thanks much!!
> >
> > java.lang.NullPointerException
> > at
> >
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2355)
> > at
> >
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:574)
> > at
> >
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:604)
> > at
> >
> org.apache.myfaces.application.NavigationHandlerImpl$PreDisposeViewCallback.visit(NavigationHandlerImpl.java:237)
> > at
> >
> org.apache.myfaces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:141)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:539)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
> > at
> >
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
> > at
> >

Re: Facelets: Back button, then nav-link click produces NPE

2012-07-06 Thread Leonardo Uribe
Hi

The line number does not match with the latest code of ApplicationImpl. But
the code that throws the NullPointerException is this:

private static SystemEvent _traverseListenerList(List listeners,
 Class systemEventClass, Object source,
 SystemEvent event)
{
if (listeners != null && !listeners.isEmpty())
{
// perf: org.apache.myfaces.application.ApplicationImpl.
//
 SystemListenerEntry.getSpecificSourceListenersNotNull(Class)
// or javax.faces.component.UIComponent.subscribeToEvent(
//  Class,
ComponentSystemEventListener)
// creates a ArrayList:
for (int i  = 0, size = listeners.size(); i < size; i++)
{
SystemEventListener listener = listeners.get(i);
// Call
SystemEventListener.isListenerForSource(java.lang.Object), passing the
source argument.
// If this returns false, take no action on the listener.
if (listener.isListenerForSource(source))
{
// Otherwise, if the event to be passed to the listener
instances has not yet been constructed,
// construct the event, passing source as the argument
to the one-argument constructor that takes
// an Object. This same event instance must be passed
to all listener instances.
event = _createEvent(systemEventClass, source, event);

// Call
SystemEvent.isAppropriateListener(javax.faces.event.FacesListener), passing
the listener
// instance as the argument. If this returns false,
take no action on the listener.
if (event.isAppropriateListener(listener))
{
// Call
SystemEvent.processListener(javax.faces.event.FacesListener), passing the
listener
// instance.
event.processListener(listener);
}
}
}
}

return event;
}

There is only one choice: list of listeners has some null elements, which
is invalid. But maybe it could be solved just adding a null check:

if (listener != null &&
listener.isListenerForSource(source))

In theory it should not happen, the code in MyFaces is correct, but the
null check is harmless. Anyway, the question is why Trinidad returns a
listener list with null values?. It could be a bug into trinidad state
saving algorithm, but without a tests sounds very difficult to solve,
because only occur in a non frequent use case.

regards,

Leonardo Uribe

2012/7/4 jnthodge :
>
> OK, we've upgraded to 2.1.7 as you suggested, and it has only changed the
> line number that throws this error in ApplicationImpl.java.  Any thoughts?
>
> Thanks much!!
>
> java.lang.NullPointerException
> at
>
org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2355)
> at
>
org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:574)
> at
>
org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:604)
> at
>
org.apache.myfaces.application.NavigationHandlerImpl$PreDisposeViewCallback.visit(NavigationHandlerImpl.java:237)
> at
>
org.apache.myfaces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:141)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:539)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
> at
>
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
> at
>
org.apache.myfaces.trinidad.component.UIXShowOne.visitTree(UIXShowOne.java:135)
> at
javax.faces.component.UIComponent.visitTree(UIComponent.java:960)
> at
> javax.faces.component.UIComponentBase.visitTree(UI

Re: Facelets: Back button, then nav-link click produces NPE

2012-07-03 Thread jnthodge

OK, we've upgraded to 2.1.7 as you suggested, and it has only changed the
line number that throws this error in ApplicationImpl.java.  Any thoughts?

Thanks much!!

java.lang.NullPointerException
at
org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2355)
at
org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:574)
at
org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:604)
at
org.apache.myfaces.application.NavigationHandlerImpl$PreDisposeViewCallback.visit(NavigationHandlerImpl.java:237)
at
org.apache.myfaces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:141)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:539)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
at
org.apache.myfaces.trinidad.component.UIXShowOne.visitTree(UIXShowOne.java:135)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:960)
at
javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1159)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
at
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:960)
at
javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1159)
at
org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:182)
at
org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:117)
at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:161)
at
org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1023)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:286)
at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1360)
at 
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:38)
at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)

Re: Facelets: Back button, then nav-link click produces NPE

2012-04-26 Thread Leonardo Uribe
Hi

It looks like you are using an old version of MyFaces. Try with the
newest ones (2.1.7, 2.0.13) first and if the problem persists please
resend the new stack trace to check it again.

regards,

Leonardo Uribe

2012/4/26 jnthodge :
>
> Hi, I'm using MyFaces + Facelets + Trinidad + WebLogic 10.3.5.
>
> When trying to use the back button to backtrack to previous pages, it seems
> the pages themselves are in the browser chache and do display alright.  Yet,
> when I try to use any Trinidad link or command button, I get a
> NullPointerException.  This is happing on every page on the site.  Yet, if I
> hit the back button, then, refresh the resulting cached page, then the
> forward navigation items work just fine.  What is going wrong here:
>
> java.lang.NullPointerException
>        at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2344)
>        at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:563)
>        at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:593)
>        at
> org.apache.myfaces.application.NavigationHandlerImpl$PreDisposeViewCallback.visit(NavigationHandlerImpl.java:236)
>        at
> org.apache.myfaces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:141)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:505)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:354)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:411)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:392)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:669)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:532)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:354)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:411)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:392)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:669)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:532)
>        at
> org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:354)
>        at
> org.apache.myfaces.trinidad.component.UIXDocument.visitTree(UIXDocument.java:82)
>        at javax.faces.component.UIComponent.visitTree(UIComponent.java:958)
>        at
> javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1073)
>        at
> org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:181)
>        at
> org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:117)
>        at
> org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:161)
>        at
> org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
>        at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1015)
>        at 
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:284)
>        at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1309)
>        at 
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:746)
>        at
> org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:38)
>        at
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
>        at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
>        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
>        at
> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
>        at
> weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
>        at
> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
>        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
>        at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
>        at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
>        at
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
>        at
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
>        at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
>        at com.myapp.filter.LoginFilter.doFilter(LoginFilter.java:59)
>        at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja