2 Replies Latest reply on Jul 18, 2008 9:16 AM by some one

    Natural Conversation "resolved to null" Problem

    some one Newbie

      I'm trying to create a natural conversation used for a registration wizard (so 3 pages). Logically I go from register.html (start) to register1.html to register2.html (end). But on the register.html page that has the form to begin the natural conversation I get the following error:



      javax.servlet.ServletException: #{memberreg.start}: javax.el.PropertyNotFoundException: /register.xhtml @47,99 action="#{memberreg.start}": Target Unreachable, identifier 'memberreg' resolved to null




      My pages.xml files contains the following:



        <conversation name="regmem"
          parameter-name="memberID"
          parameter-value="#{memberreg.newMember.memberID}"/>
      
        <page view-id="/register.xhtml">
          <navigation from-action="#{memberreg.start}">
            <begin-conversation join="true" conversation="regmem"/>
          </navigation>
          <navigation>
            <rule if="#{identity.loggedIn}">
              <redirect view-id="/index.xhtml"/>
            </rule>
          </navigation>
        </page>
      
        <page view-id="/register1.xhtml" conversation-required="true"
          conversation="regmem">
          <restrict>#{memberreg.started}</restrict>
          <navigation from-action="#{memberreg.agreeToLicense}">
            <rule if="#{memberreg.agree}">
              <redirect view-id="/register2.xhtml"/>
            </rule>
          </navigation>
          <navigation from-action="#{memberreg.cancel}">
            <rule if="#{not memberreg.agree}">
              <redirect view-id="/index.xhtml"/>
            </rule> 
          </navigation>
          <navigation>
            <rule if="#{identity.loggedIn}">
              <redirect view-id="/index.xhtml"/>
            </rule>
          </navigation>
        </page>
      
        <page view-id="/register2.xhtml" conversation-required="true"
          conversation="regmem">
          <restrict>#{memberreg.agree}</restrict>
          <navigation from-action="#{memberreg.end}">
            <end-conversation before-redirect="true"/>
          </navigation>
          <navigation>
            <rule if="#{identity.loggedIn}">
              <redirect view-id="/index.xhtml"/>
            </rule>
          </navigation>
        </page>




      My register.xhtml form has in it:



      <h:commandButton value="REGISTER" action="#{memberreg.start}" styleClass="submit">
        <s:conversationName value="regmem"/>
      </h:commandButton>



      This is (as far as I can tell) what the SeamBay example is doing. However. The above posted error is what I get when submitting the form. It appears that with the conversationName attribute it cannot find any conversation of the name 'memberreg'. I've read through the 2.0.2 documentation, done a search on this forum, the JBoss forum, and Googled dozens of pages but I've not found what I'm doing wrong.


      Also, before I added the natural conversation to the webapp, there were no errors so the problem should be specific to natural conversations (i.e., the memberreg bean has all the required methods available).


      Anyone know what I may be doing wrong?



        • 1. Re: Natural Conversation "resolved to null" Problem
          some one Newbie

          Actually I realize that what I posted is wrong although not what I was working with. My pages.xml file with the register.html page is actually:



            <page view-id="/register.xhtml">
              <param name="memberID" value="#{memberreg.newMember.memberID}"/>
              <navigation from-action="#{memberreg.start}">
                <begin-conversation join="true" conversation="regmem"/>
                <rule if="#{memberreg.agree}">
                  <redirect view-id="/register2.xhtml"/>
                </rule>
                <rule if="#{memberreg.started}">
                  <redirect view-id="/register1.xhtml"/>
                </rule>
              </navigation>
              <navigation>
                <rule if="#{identity.loggedIn}">
                  <redirect view-id="/index.xhtml"/>
                </rule>
              </navigation>
            </page>



          I also tried replacing the h:commandButton and s:conversationName combo with the s:link that was suggested from chapter 7 of the online Seam book. The only problem that seems close is the one at:


          Error redirecting to natural conversation


          • 2. Re: Natural Conversation "resolved to null" Problem
            some one Newbie

            Okay, so I solved that particular problem. For anyone else, what you need to do is change this:


            <h:commandButton value="REGISTER" action="#{memberreg.start}"
              styleClass="submit">
              <s:conversationName value="regmem"/>
            </h:commandButton>




            To this:


            <h:commandButton value="REGISTER" action="#{memberreg.start}"
              styleClass="submit">
              <s:conversationName value="regmem"/>
              <s:conversationPropagation type="begin"/>
            </h:commandButton>



            Specifically, using the conversationPropagation element to specify whether or not you're beginning, joining, ending, or nesting a conversation. I got this from Chapter 7, section 7.1 of the 2.0.2 online JBoss Seam book.


            A question I have for anyone who knows more about this is: am I doing this right? :) I mean it doesn't crash and there are no error messages but I am completely new to this and literature is scarce on this particular topic.


            Btw, I've been doing all of this in Tomcat 6.x under Ubuntu 7.10 on the Intel platform.