0 Replies Latest reply on Oct 7, 2008 6:03 AM by Nikolay Elenkov

    Target unreachable exception when clicking menu s:links too fast

    Nikolay Elenkov Master


      I have the following use case: a menu with links to top pages in my
      application, clicking a menu link should end the current conversation
      and redirect to the relative page, where a new converstaion is started.
      (seems a fairly common use case, at least in this forum)

      Here is how I've implemented it:

      • menu.xhtml

      <s:link action="list-foos" value="List Foos" />
      <s:link action="register-foo" value="Register Foo" />

      • pages.xml

      <page view-id="*">
          <rule if-outcome="list-foos">
            <end-conversation before-redirect="true" />
            <redirect view-id="/foo-list.xhtml"/>
          <rule if-outcome="register-foo">
            <end-conversation before-redirect="true" />
            <redirect view-id="/foo-registration.xhtml" />

      It works as expected, but if a user clicks too fast through the menu links,
      I sometimes get an Target Unreachable, identifier 'foo' resolved to null exception.
      The trace is bellow:

      [javax.enterprise.resource.webcontainer.jsf.lifecycle] executePhase(PROCESS_VALIDATIONS 3,com.sun.faces.context.FacesContextImpl@302e8d04) threw exception
      javax.faces.FacesException: /foo-registration.xhtml @35,73 value="#{foo.name}": Target Unreachable, identifier 'foo' resolved to null

      Since the *-register pages have AJAX validations executed on lost focus
      (using <a4j:support event="onblur"/> tags), it seems that AJAX requests are sent after a
      conversation has ended, and that triggers the Exception above.

      Seems similar to JBSEAM-1832, but that's addressed in 2.1 and I am using 2.0.3, so I cannot
      try it.

      Any ideas as how to handle this in Seam 2.0.3? Should I try to backport the 2.1 fix (possible?)
      or is there an easier way?


      Environment: JBoss 4.2.2, Seam 2.0.3