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 lu4...@gmail.com 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? extends
 SystemEventListener listeners,
  Class? extends
 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? extends SystemEvent,
 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 jntho...@hotmail.com:

 
  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)
  

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? extends
SystemEventListener listeners,
 Class? extends
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? extends SystemEvent,
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 jntho...@hotmail.com:

 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
 

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)