3 Replies Latest reply on Jun 16, 2010 4:26 AM by jonssonth

    Very crazy problem popping up

    hardaur

      Seam 2.2.0 JBoss-4.2.3.GA


      I'm tweaking my registration process and have a situation where my conversation is being killed in the method that actually creates my users.  To make matters worse, it's happening inside seam and for the life of me I can't understand why or where.


      Here's a bit of code


       System.out.println("1.5 ==========startcreateConversation = " + Conversation.instance().getId() + "Long running = " + Conversation.instance().isLongRunning());
                      identityManager.createUser(username, password);
                      System.out.println("2 ==========startcreateConversation = " + Conversation.instance().getId() + "Long running = " + Conversation.instance().isLongRunning());
      


      So note that the conversation information is being displayed on either side of the call to identityManager.createuser().  Here's the output:


      08:41:14,856 INFO  [STDOUT] 1.5 ==========startcreateConversation = 1Long running = true
      08:41:14,928 INFO  [STDOUT] Hibernate: 
          select
              useraccoun0_.id as id674_,
              useraccoun0_.created_at as created2_674_,
              useraccoun0_.created_by as created3_674_,
              useraccoun0_.updated_by as updated4_674_,
              useraccoun0_.updated_at as updated5_674_,
              useraccoun0_.admin_notes as admin6_674_,
              useraccoun0_.enabled as enabled674_,
              useraccoun0_.user_id as user11_674_,
              useraccoun0_.username as username674_,
              useraccoun0_.password_hash as password9_674_,
              useraccoun0_.prefStore as prefStore674_ 
          from
              user_account useraccoun0_ 
          where
              useraccoun0_.username=?
      08:41:14,989 INFO  [STDOUT] 2 ==========startcreateConversation = 1Long running = false
      
      



      So somehow something in identityManager.createUser is trying to terminate the longRunning conversation!


      I've tried absolutely everything I can think of including every way I can conceive of searching for other folks with this problem. 


      Is this correct behavior?  If so are there suggestions for getting that info back in active conversation (need name info on confirmation pages).  Am I doing something wrong/stupid?


      Any insight into this would be extremely appreciated, I'm getting desperate at this point.


      Gerald

        • 1. Re: Very crazy problem popping up
          jonssonth

          I don't know if the conversation ends if an exception occurs in this case. But lets pretend that so is the case a duplicate username could be the issue.



          From JpaIdentityStore.java and createUser(...)




          if (userExists(username))
                   {
                      throw new IdentityManagementException("Could not create account, already exists");
                   }





          • 2. Re: Very crazy problem popping up
            hardaur

            There's a validator for duplicate usernames.  However, still not sure why/what happened but it appears to have been something in a CustomIdentity component.  Rewrote a couple pieces that have been problematic and it seems to be working again (I hope, have JUST finished and run 1 test).


            Thanks!
            Gerald

            • 3. Re: Very crazy problem popping up
              jonssonth

              Alright. Great that you solved it!