[jboss-user] [JBoss Seam] - Conversation Beans and Session scoped beans resulting in "Co

limousyf do-not-reply at jboss.com
Wed Jan 23 04:53:08 EST 2008


Hello,

I just had the "Could not find stateful Bean" error in my application.
After searching in the forum, I finally understand that a bean with a wider scope (Session) kept a reference of the stateful bean that cannot be find by other sessions.

Here is some snipplets of my code:


The session-scoped bean


  | @Scope(ScopeType.SESSION)
  | @Name("gestionaffichage")
  | public class GestionAffichageBean implements GestionAffichage
  | 


The stateful bean


  | @Stateful
  | @Scope(ScopeType.CONVERSATION)
  | @Name("activitesByCollaborateurCrossData")
  | public class activitesByCollaborateurCrossDataBean implements activitesByCollaborateurCrossData
  | 
  | 
  | bla bla bla ...
  | 
  | 
  | 	@In
  | 	public GestionAffichage gestionaffichage;
  | 
  | 
  | yada  yada ...
  | 
  | 
  | 	public void setRealise()
  | 	{
  | 		this.realise = true;
  | 		this.debut();
  | 		gestionaffichage.afficherMenuActiviteParCollaborateur();
  | 	}
  | 


Since I add the "gestionaffichage" calls in my stateful bean, "Could not find stateful Bean" errors appeared.
I temporary moved the scope of "gestionaffichage" to APPLICATION  to avoid problems but it's not supposed to be shared between clients.

My question is: why does this error happen ?

I mean, I don't have a reference of my stateful bean in my session-scoped bean; I have the exact opposite: an injection of my session-scoped bean in the conversation.

So I don't get how the error is supposed to happen.
Can't I inject a "wider" scoped bean in my conversation ?
I certainly missed something here but I don't know what ...

Regards

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

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



More information about the jboss-user mailing list