[ 
https://issues.apache.org/jira/browse/TOBAGO-1589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16365558#comment-16365558
 ] 

Udo Schnurpfeil edited comment on TOBAGO-1589 at 2/15/18 2:32 PM:
------------------------------------------------------------------

The problem happens, with each AJAX refresh while component rebuild 
(resoreView) of the sheet paging or sorting command facets.

In the example, you need to set sortable="false" and rows="100". In that case, 
there is no such command, and it will work. 

Current test:
{code}
<?xml version="1.0" encoding="UTF-8"?>

<ui:composition template="/plain.xhtml"
                xmlns="http://www.w3.org/1999/xhtml";
                xmlns:tc="http://myfaces.apache.org/tobago/component";
                xmlns:ui="http://java.sun.com/jsf/facelets";
                xmlns:f="http://java.sun.com/jsf/core";>

  <tc:button image="fa-refresh" label="reload out">
    <f:ajax execute="out" render="out"/>
  </tc:button>

  <tc:out id="out" value="#{sheetSortingController.solarList[0].name}" 
label="Name"/>

  <tc:button image="fa-refresh" label="reload sheet">
    <f:ajax execute="sheet" render="sheet"/>
  </tc:button>

  <tc:sheet id="sheet" value="#{sheetSortingController.solarList}" var="object" 
rendered="true" rows="50">
    <tc:column label="Name" sortable="false">
      <tc:out value="#{object.name}"/>
    </tc:column>
  </tc:sheet>

</ui:composition>
{code}

Exception (e.g. Mojarra 2.3):
{code}
javax.faces.FacesException: java.lang.NullPointerException
        at 
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:271)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at 
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:133)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
        at 
org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
        at 
javax.faces.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:97)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
        at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
        at 
org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
        at 
org.apache.myfaces.tobago.facelets.FixCharacterEncodingFilter.doFilter(FixCharacterEncodingFilter.java:53)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
        at 
org.apache.myfaces.tobago.internal.webapp.LoggingMdcFilter.doFilter(LoggingMdcFilter.java:67)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
        at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:561)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:334)
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
        at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at 
javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2654)
        at javax.faces.event.SystemEvent.processListener(SystemEvent.java:147)
        at 
javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:134)
        at 
com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2296)
        at 
com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2241)
        at 
com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:341)
        at 
com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:299)
        at 
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:748)
        at 
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:748)
        at 
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:748)
        at 
org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.publishEvent(InjectionAwareApplicationWrapper.java:148)
        at 
javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2309)
        at 
javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1986)
        at 
javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:459)
        at 
javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:3105)
        at 
javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:3061)
        at 
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreDynamicAdd(FaceletPartialStateManagementStrategy.java:293)
        at 
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreDynamicActions(FaceletPartialStateManagementStrategy.java:227)
        at 
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreView(FaceletPartialStateManagementStrategy.java:396)
        at 
com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:139)
        at 
com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
        at 
com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:295)
        at 
com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:157)
        at 
javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:125)
        at 
javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:125)
        at 
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:204)
        ... 44 more
{code}

Replacing one method in the SheetController of the demo to see the AJAX results 
better:
{code}
  public List<SolarObject> getSolarList() {
    final SolarObject solarObject = solarList.get(0);
    solarObject.setName("Sun (Time: " + new 
SimpleDateFormat("ss,SSS").format(new Date()) + ")");
    return solarList;
  }
{code}


was (Author: lofwyr):
The problem happens, with each AJAX refresh while component rebuild 
(resoreView) of the sheet paging or sorting command facets.

In the example, you need to set sortable="false" and rows="100". In that case, 
there is no such command, and it will work. 

Current test:
{code}
<?xml version="1.0" encoding="UTF-8"?>

<ui:composition template="/plain.xhtml"
                xmlns="http://www.w3.org/1999/xhtml";
                xmlns:tc="http://myfaces.apache.org/tobago/component";
                xmlns:ui="http://java.sun.com/jsf/facelets";
                xmlns:f="http://java.sun.com/jsf/core";>

  <tc:button image="fa-refresh" label="reload out">
    <f:ajax execute="out" render="out"/>
  </tc:button>

  <tc:out id="out" value="#{sheetSortingController.solarList[0].name}" 
label="Name"/>

  <tc:button image="fa-refresh" label="reload sheet">
    <f:ajax execute="sheet" render="sheet"/>
  </tc:button>

  <tc:sheet id="sheet" value="#{sheetSortingController.solarList}" var="object" 
rendered="true" rows="50">
    <tc:column label="Name" sortable="false">
      <tc:out value="#{object.name}"/>
    </tc:column>
  </tc:sheet>

</ui:composition>
{code}

Exception (e.g. Mojarra 2.3):
{code}
javax.faces.FacesException: java.lang.NullPointerException
        at 
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:271)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at 
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:133)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
        at 
org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
        at 
javax.faces.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:97)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
        at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
        at 
org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
        at 
org.apache.myfaces.tobago.facelets.FixCharacterEncodingFilter.doFilter(FixCharacterEncodingFilter.java:53)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
        at 
org.apache.myfaces.tobago.internal.webapp.LoggingMdcFilter.doFilter(LoggingMdcFilter.java:67)
        at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
        at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:561)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:334)
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
        at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at 
javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2654)
        at javax.faces.event.SystemEvent.processListener(SystemEvent.java:147)
        at 
javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:134)
        at 
com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2296)
        at 
com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2241)
        at 
com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:341)
        at 
com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:299)
        at 
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:748)
        at 
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:748)
        at 
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:748)
        at 
org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.publishEvent(InjectionAwareApplicationWrapper.java:148)
        at 
javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2309)
        at 
javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1986)
        at 
javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:459)
        at 
javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:3105)
        at 
javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:3061)
        at 
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreDynamicAdd(FaceletPartialStateManagementStrategy.java:293)
        at 
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreDynamicActions(FaceletPartialStateManagementStrategy.java:227)
        at 
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreView(FaceletPartialStateManagementStrategy.java:396)
        at 
com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:139)
        at 
com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
        at 
com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:295)
        at 
com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:157)
        at 
javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:125)
        at 
javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:125)
        at 
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:204)
        ... 44 more
{code}

> Sorting in sheet work not with Mojarra 2.0
> ------------------------------------------
>
>                 Key: TOBAGO-1589
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-1589
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Themes
>    Affects Versions: 2.0.9, 3.0.0-alpha-4
>            Reporter: Udo Schnurpfeil
>            Assignee: Udo Schnurpfeil
>            Priority: Minor
>
> There is still a problem with Mojarra 2.0.
> With Mojarra 2.1 this is fixed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to