2 Replies Latest reply on Aug 17, 2009 6:09 PM by Julien Kronegg

    Target unreachable after iterating a couple times of actions

    Jeff Newbie
      The JSF page shows one item at a time, user does something on the item, then clicks "Next" button to move to the next item. Behind the scene is the data user entered are saved into database and next item is retrieved from database and presented to user. The loop continues until no more item found in the database. All these occurs on the same JSF page. All kinds of conversation scopes are tried but didn't help. Any help and/or advice is highly appreciated.

      Here is the JSF page:
      |<h:form id="itv">
              <!-- Question -->
              <a4j:outputPanel id="topicPanel">
                  <h:outputText value="#{currentElement.topic}"/>
              </a4j:outputPanel>
              <rich:separator />
              <!-- choices -->
              <a4j:outputPanel id="choicePanel">
                  <!-- inputText -->
                  <h:inputText id="tbox" size="20" value="#{currentElement.userInput}"
                               rendered="#{currentElement.inputType == 0}"/>
                  <!-- checkBox -->
                  <h:selectManyCheckbox id="mbox" layout="pageDirection"
                                        value="#{currentElement.selections}"
                                        rendered="#{currentElement.inputType == -1}">
                          <f:selectItems value="#{outData}" />
                  </h:selectManyCheckbox>
                  <!-- radioButton -->
                  <h:selectOneRadio id="ubox" layout="pageDirection"
                                        value="#{curentElement.oneChoice}"
                                        rendered="#{currentElement.inputType == 1}">
                          <f:selectItems value="#{outData}" />
                  </h:selectOneRadio>
                  <rich:spacer />
                  <!-- commands -->
                  <h:panelGrid columns="3">
                      <a4j:commandLink reRender="itv,messages" action="#{currentElement.goPrev}" value="Prev"
                                       rendered="#{currentElement.prevPageAvailable}">
                          <s:conversationPropagation type="nested"/>
                      </a4j:commandLink>
                      <rich:spacer/>
                      <a4j:commandLink reRender="itv,messages" action="#{currentElement.finish}"
                                       value="Finish" rendered="#{!currentElement.nextPageAvailable}">
                      </a4j:commandLink>
                      <a4j:commandLink reRender="itv,messages" action="#{currentElement.goNext}" value="Next"
                                       rendered="#{currentElement.nextPageAvailable}">
                          <s:conversationPropagation type="nested"/>
                      </a4j:commandLink>
                  </h:panelGrid>
              </a4j:outputPanel>
              <rich:spacer />
              <!-- Progess bar -->
              <rich:separator width="50%" height="2px" lineType="dashed" rendered="#{currentElement.cnt > 0}"/>
              <rich:spacer />
              <a4j:outputPanel id="progressPanel">
                  <rich:progressBar value="#{currentElement.cnt}" interval="500"
                      minValue="0" maxValue="#{currentElement.dataNo}" enabled="true"
                      reRenderAfterComplete="progressPanel" rendered="#{currentElement.cnt > 0}">
                      <h:outputText value="#{currentElement.cnt} out of #{currentElement.dataNo}"/>
                  </rich:progressBar>
              </a4j:outputPanel>
          </h:form>|

      Error message:
      "org.jboss.seam.jsf.SeamPhaseListener afterPhase
      WARNING: uncaught exception, passing to exception handler
      java.lang.NullPointerException
              at org.jboss.seam.core.Manager.handleConversationPropagation(Manager.java:568)
              at org.jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:539)
              at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:392)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:228)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
              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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              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:178)
              at org.ajax4jsf.webapp.BaseFilter..handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11..Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)
      May 21, 2009 7:35:58 PM org.jboss.seam.jsf..SeamPhaseListener afterPhase
      SEVERE: swallowing exception
      java.lang.NullPointerException
              at org.jboss.seam.core.Manager.handleConversationPropagation(Manager.java:568)
              at org.jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:539)
              at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:392)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:228)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
              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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter..java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              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:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)
      May 21, 2009 7:35:58 PM com.sun.faces.lifecycle.ProcessValidationsPhase execute
      WARNING: /interviewData/interview.xhtml @41,79 value="#{curentElement.oneChoice}": Target Unreachable, identifier 'curentElement' resolved to null
      javax.el.PropertyNotFoundException: /interviewData/interview.xhtml @41,79 value="#{curentElement.oneChoice}": Target Unreachable, identifier 'curentElement' resolved to null
              at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)
              at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:81)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectOneValue(MenuRenderer.java:197)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:359)
              at javax.faces..component.UIInput.getConvertedValue(UIInput.java:934)
              at javax.faces.component.UIInput.validate(UIInput..java:860)
              at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
              at javax.faces.component.UIInput.processValidators(UIInput.java:666)
              at javax.faces..component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIForm.processValidators(UIForm.java:229)
              at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
              at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
              at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
              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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              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:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote..http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)"
        • 1. Re: Target unreachable after iterating a couple times of actions
          Julien Kronegg Novice

          I got the same issue (NPE at org.jboss.seam.core.Manager on line 568) on Seam 2.1.2. My code was:


          <h:commandButton value="Save" action="#{foyerHome.persistOrUpdateEmails}" ><s:conversationPropagation type="nested" /></h:commandButton>
          



          Below is the Manager's code snippet:


                   case NEST:
                      if ( isLongRunningOrNestedConversation() ) 
                      {
                          beginNestedConversation();
                      }
                      else 
                      {
                          beginConversation();
                      }
                      
                      if (propagation.getPageflow() != null)
                      {
                         Pageflow.instance().begin( propagation.getPageflow() ); // <- line 568
                      }
                      break;
          



          It appears that Pageflow.instance() is null. The PageFlow class is a Seam component with the following @Install annotation:


          @Install(dependencies="org.jboss.seam.bpm.jbpm", precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")



          According to Seam documentation, the component is not installed if one of the dependency is not available. This is the case as the log file displays:


          17:36:27,469 TRACE [Component] Seam component not found: org.jboss.seam.pageflow.pageflow



          I don't know why the propagation.getPageflow() was not null, but IMHO Seam should check if the PageFlow.instance() is null before calling its begin() method.


          Note: I have currently no solution for that issue.