7 Replies Latest reply on Aug 13, 2008 10:59 PM by msudha_99

    Errors after redirection to error page from exception in stateful session bean

      I have configured pages.xml to redirect to an error page after an exception.  The general case is as follows:


          <exception>
              <end-conversation/>
              <redirect view-id="/error.xhtml">
                  <message>Unexpected error, please try again</message>
              </redirect>
          </exception>


         
      This is working up to a point, in that the error page appears but there seems to be a problem with the clean up of the conversation and/or session bean. 


      I have replicated at least part of my problem in the Seam hotel booking example by adding redirection to an error page (as per config above), removing required=true on the credit card input field, and submitting a booking without completing the credit card number.  In the log I see the following trace info:



      Caused by: org.hibernate.validator.InvalidStateException: validation failed for: org.jboss.seam.example.booking.Booking
              at org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:143)
              at org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:167)
      
      ...
      
      WARN  [Component] Exception calling stateful session bean default @Remove method: hotelBooking
      javax.ejb.NoSuchEJBException: Could not find stateful bean: 5c4oa6t-xt2mlm-fegrf2y7-1-fei8kw21-bl
              at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
      



      The first message is expected - i.e. an exception was raised during validation of the model.  The second message seems to lead on to further issues.  In my application I am using natural conversations. 
      When I try to restart the conversation by simply browsing to the appropriate url, I get the following error:


      Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 5c4oa6t-xt2mlm-fegrf2y7-1-fei8qy74-c8
              at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
              at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
      



      On the second attempt, the conversation is succesfully started.  Is this a bug?  Any workarounds?  Should I raise in Jira?


      Appologies if this has been raised elsewhere, but I did search and couldn't find anything on the issue.
      Thanks
      Willy