[jboss-user] [JBoss Seam] - Re: Invitation to try new Seam authentication features

msteiner do-not-reply at jboss.com
Tue Sep 5 04:45:05 EDT 2006


"sbryzak2" wrote : 
  | The security API doesn't do anything specifically with transactions.  Is this problem happening in your AuthenticationProvider?
  | 
No.

I think I know where is the problem.  It may be connected with my problems with seam security when debug is turned on.  
One of security components throws:
org.jboss.seam.security.AuthenticationException: No Authentication could be created, make sure the Component exists in session scope
Later this exception is swallowed but first is catched by RollbackInterceptor

  catch (Exception e)
  |       {
  |          //Any exception that propagates out of a JavaBean component
  |          //causes a transaction rollback
  |          if ( component.getType()==ComponentType.JAVA_BEAN )
  |          {
  |             try
  |             {
  |                Transactions.setUserTransactionRollbackOnly();
  |             }
  |             catch (Exception te) {} //swallow
  |          }
  |          throw e;
  |       }
  |    }

So transtaction is marked to rollback this makes SeamPhaseListener to create message: Transaction failed
here is code from SeamPhaseListener
 else if ( event.getPhaseId() == INVOKE_APPLICATION )
  |       {
  |          try
  |          {
  |             if ( Transactions.isTransactionAvailableAndMarkedRollback() )
  |             {
  |                FacesMessages.instance().addFromResourceBundle(
  |                         FacesMessage.SEVERITY_WARN, 
  |                         "org.jboss.seam.TransactionFailed", 
  |                         "Transaction failed"
  |                      );
  |             }
  |          }
  |          catch (Exception e) {} //swallow silently, not important
  |       }
  |             



Set breakpoint in RollbackInterceptor at line 63 
  Transactions.setUserTransactionRollbackOnly();
And open page http://localhost:8080/seam-security/home.seam

During one request RollbackInterceptor is called two times: one with AuthenticationException and one with NullPointerException.  Is this ok ?





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969386#3969386

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969386



More information about the jboss-user mailing list