6 Replies Latest reply on Sep 25, 2008 4:19 PM by vincent.crepin

    Nested conversation

    vincent.crepin

      Hello Seam users.


      I know that this kind of problem has been submitted many times in many different flavors but I can't determine the cause of my problem.


      Here is a description of it.


      I Have an application which consists mainly of 2 pages. The first is a list of items and the second is an editor page for an item in the list.


      When I enter the first page, I start a Conversation (@Begin) on a stateful bean with Conversation scope. I need this conversation because my list must keep track of different states as sort order, sort field, page selected etc.


      When I click on an item to edit it, I switch to the second page starting a nested conversation. I can then take action on the item and return to the list that I find in the state I left it. My problem starts here. The list is correctly rendered but when I do an action on it, I get an exception (NullPointerException) on the first property of the backing bean that I access.


      I put the conversationList dataTable on my pages to track the conversations and everything seems fine. On the first page, I have 1 conversation. On the second, I have 2 with the second as current and it is nested. When I come back to my list page, I have only one conversation left and it is exactly the same as when I started (same ID, accessedDate refreshed).


      So, here are the relevant portions of code:


      The method that starts the conversation on the list backing bean


             @Begin
              @Override
              @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
              public String enterList() {
                      this.currentKilometerEntryMonth = null;
                      this.com_servier_hr_session_uievents_kilometerEntryMonths = null;
                      queryObjects();
                      this.carPanelRendered = false;
      
                      return "kilometerEntryMonthList";
              }




      kilometerEntryMonthList is the logical name of the list page as defined in
      pages :


              <page view-id="/kilometerEntry/kilometerEntryMonthList.xhtml"
                      login-required="true">
                              <description>The month list page of the application</description>
                      
                      <navigation>
                              <rule if-outcome="carList">
                                      <redirect
                                              view-id="/kilometerEntry/#{com_servier_hr_session_uievents_carListAction.enterList()}.xhtml">
                                      </redirect>
                              </rule>
                      </navigation>
              </page>




      The link to the second page :


               <a4j:commandLink id="monthListYearMonthColumnLink"
                                      action="#{com_servier_hr_session_uievents_kilometersEdit.enterEdit(kilometerEntryMonthDTO)}">
                                      <h:outputText value="#{kilometerEntryMonthDTO.yearMonth}"
                                              id="monthListYearMonthColumnOutputText" />
                                      <f:param name="conversationPropagation" value="join" />
                                      <s:conversationPropagation type="join" />
              </a4j:commandLink>




      The method enterEdit on the backing bean of the second page :


             @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
              @Begin(nested = true)
              public String enterEdit(KilometerEntryMonthDTO kilometerEntryMonthDTO) {
                      this.ownerServierUser = null;
                      this.setPreviousKilometerEntry(null);
                      this.nextKilometerEntry = null;
                      this.setCurrentKilometerEntry(null);
                      this.currentKilometerEntryMonth = null;
                      this.com_servier_hr_session_uievents_car = null;
                      createNeededServices();
              ---




      The link on the second page to return to the first :


                <rich:menuItem submitMode="ajax" id="goBackToListMenuItem"
                                              value="#{messages['KilometerEntry.cmdBack.tooltip']}"
                                              action="#{com_servier_hr_session_uievents_kilometersEdit.returnToMonthList()}"
                                              eventsQueue="treeQueue" bypassUpdates="true" immediate="true"
                                              <f:facet name="icon">
                                                      <h:graphicImage value="/img/actions/back.gif"
                                                              id="goBackToListImage" />
                                              </f:facet>
                                      </rich:menuItem>




      The method on the backing bean of the second page that ends the nested conversation :


             @End()
              @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
              public String returnToMonthList() {             
                      return "kilometerEntryMonthList";
              }




      The entry for that second page in pages.xml :


              <page view-id="/kilometerEntry/kilometerEntryList.xhtml"
                      login-required="false">
                              <description>The edition of the monthly entries</description>               
                      <navigation>
                              <rule if-outcome="kilometerEntryMonthList">
                                      <redirect
                                              view-id="/kilometerEntry/#{com_servier_hr_session_uievents_KilometerEntryMonthSearch.returnToList()}.xhtml">
                                      </redirect>
                              </rule>
                      </navigation>
              </page>
      



      And finally, the method on the backing bean of the list page that the previous navigation rule refers to :


             @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
              public String returnToList(){
                      queryObjects();
                      if(this.sortField!=null){
                              this.sortAscending = !this.sortAscending;
                              this.sortDataList(this.sortField);
                      }
                      return "kilometerEntryMonthList";
              }




      Voila, if someone sees something that I don't, it would be highly appreciated.


      Vincent.

        • 1. Re: Nested conversation
          vincent.crepin

          There's something I forgot to mention and it is very important...


          The scenario I just described works when I enter the edit page and simply return. It does not work when in the edit page, I open a modal panel that allows to modify certain properties of the item.


          I just open the modal panel, close it with cancel, do not save the changes (I did not do any anyway) and go back to the list.


          This is when the problem arises.


          Thanks.

          • 2. Re: Nested conversation
            vincent.crepin

            The modal panel has its own form if that could be of any help...


            • 3. Re: Nested conversation
              swd847

              Can you post the NPE stack trace?

              • 4. Re: Nested conversation
                vincent.crepin

                Sorry, what does NPE mean ?


                Here is the stack trace of the error if this is what you want to see.


                As I said before, the backing bean of the list seems to be resetted even if the conversation seems fine (by looking at conversationList). When I say resetted, I do not mean init (method annotated with @Create) that would at least avoid the NullPointerException that I have. It simply looses all its values that are set to null.


                Stack Trace:



                23:54:04,515 WARN  [lifecycle] /kilometerEntry/monthListPanel.xhtml @44,43 actionListener="#{com_servier_hr_session_uievents_KilometerEntryMonthSearch.sortDataList('yearMonth')}": java.lang.NullPointerException
                javax.faces.el.EvaluationException: /kilometerEntry/monthListPanel.xhtml @44,43 actionListener="#{com_servier_hr_session_uievents_KilometerEntryMonthSearch.sortDataList('yearMonth')}": java.lang.NullPointerException
                     at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
                     at javax.faces.component.UICommand.broadcast(UICommand.java:376)
                     at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
                     at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1379)
                     at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
                     at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
                     at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
                     at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
                     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:522)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                     at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                     at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                     at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                     at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                     at java.lang.Thread.run(Thread.java:619)
                Caused by: java.lang.NullPointerException
                     at java.util.Collections.sort(Collections.java:158)
                     at com.servier.hr.session.uievents.KilometerEntryMonthSearchAction.sortDataList(KilometerEntryMonthSearchAction.java:283)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                     at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                     at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                     at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                     at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
                     at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                     at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                     at $Proxy274.sortDataList(Unknown Source)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                     at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                     at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                     at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                     at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                     at org.javassist.tmp.java.lang.Object_$$_javassist_4.sortDataList(Object_$$_javassist_4.java)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                     at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
                     at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
                     at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
                     at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                     at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                     at org.jboss.seam.el.OptionalParameterMethodExpression.invoke(OptionalParameterMethodExpression.java:39)
                     at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                     at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
                     ... 53 more
                23:54:04,532 WARN  [lifecycle] executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@fbf2c) threw exception
                javax.faces.FacesException: /kilometerEntry/monthListPanel.xhtml @44,43 actionListener="#{com_servier_hr_session_uievents_KilometerEntryMonthSearch.sortDataList('yearMonth')}": java.lang.NullPointerException
                     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)
                     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:522)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                     at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                     at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                     at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                     at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                     at java.lang.Thread.run(Thread.java:619)
                Caused by: javax.faces.el.EvaluationException: /kilometerEntry/monthListPanel.xhtml @44,43 actionListener="#{com_servier_hr_session_uievents_KilometerEntryMonthSearch.sortDataList('yearMonth')}": java.lang.NullPointerException
                     at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
                     at javax.faces.component.UICommand.broadcast(UICommand.java:376)
                     at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
                     at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1379)
                     at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
                     at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
                     at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
                     at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
                     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                     ... 45 more
                Caused by: java.lang.NullPointerException
                     at java.util.Collections.sort(Collections.java:158)
                     at com.servier.hr.session.uievents.KilometerEntryMonthSearchAction.sortDataList(KilometerEntryMonthSearchAction.java:283)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                     at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                     at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                     at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                     at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
                     at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                     at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                     at $Proxy274.sortDataList(Unknown Source)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                     at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                     at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                     at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
                     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                     at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                     at org.javassist.tmp.java.lang.Object_$$_javassist_4.sortDataList(Object_$$_javassist_4.java)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                     at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
                     at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
                     at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
                     at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                     at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                     at org.jboss.seam.el.OptionalParameterMethodExpression.invoke(OptionalParameterMethodExpression.java:39)
                     at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                     at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
                     ... 53 more
                


                • 5. Re: Nested conversation
                  vincent.crepin

                  I found that in my modal panel, this control is causing the problem because if I simply remove it, the problem disappear (I can go back to my list and everything works fine).



                                                                                           <h:selectOneMenu id="countryCombobox"
                                                                    value="#{com_servier_hr_session_uievents_fastKilometersEdit.currentKilometerEntryBusinessActivity.country}"
                                                                    defaultLabel="#{messages['KilometerEntry.noSelection.label']}"
                                                                    layout="inline"
                                                                    rendered="#{com_servier_hr_session_uievents_fastKilometersEdit.currentKilometerEntryBusinessActivity.fromPDA==null or com_servier_hr_session_uievents_fastKilometersEdit.currentKilometerEntryBusinessActivity.fromPDA==false}">
                                                               
                                                                    <s:selectItems
                                                                         value="#{com_servier_parameters_session_services_countryQuery.allCountries}"
                                                                         var="coun" label="#{coun.label}"
                                                                         noSelectionLabel="#{messages['KilometerEntry.noSelection.label']}"
                                                                         disabled="#{not com_servier_hr_session_uievents_fastKilometersEdit.canEditCurrentKilometerEntry()}" />
                                                                    <s:convertEntity />
                                                               </h:selectOneMenu>



                  So It seems that s:selectItems and s:convertEntity mess with my root conversation in any way. Isn't it strange ? The equals method on Country is correctly adjusted and countryQuery is a stateless session ejb3 that returns the ejb3 Country entities.


                  For further info, here is the method of that service :



                  @SuppressWarnings("unchecked")
                       @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                       public List<Country> getAllCountries() {
                            Query query = em.createNamedQuery("Country.getAllActiveCountries");
                            // TODO find a way to refresh cache when changing an object
                            query.setHint("org.hibernate.cacheable", true);
                  
                            // by default, we sort by label alphabetically
                            List<Country> list = query.getResultList();
                            java.util.Collections.sort(list, new DTOComparator("label", true));
                  
                            return list;
                       }



                  Could the cache have something to do with the problem ???

                  • 6. Re: Nested conversation
                    vincent.crepin

                    Well, I removed s:convertEntity and replaced it with my own converter and the problem disappeared...


                    My converter:



                    @SuppressWarnings("serial")
                    @Name("com_servier_parameters_session_uievents_converters_countryConverter")
                    @org.jboss.seam.annotations.faces.Converter(forClass = Country.class)     
                    @BypassInterceptors()     
                    public class CountryConverter implements Converter {
                         private CountryQuery com_servier_parameters_session_services_countryQuery;
                         
                        public Object getAsObject(FacesContext context, UIComponent component, String value) {
                            if(com_servier_parameters_session_services_countryQuery == null)
                                 com_servier_parameters_session_services_countryQuery = 
                                      (CountryQuery)Component.getInstance("com_servier_parameters_session_services_countryQuery", true);
                            
                             return com_servier_parameters_session_services_countryQuery.getCountry(value);
                        }
                    
                        public String getAsString(FacesContext context, UIComponent component, Object value) {        
                            return ((Country) value).getKeyCode();
                        }
                    }
                    


                    This is a workaround, not a solution. There seems to be a problem with s:convertEntity...