[jboss-user] [JBoss Seam] - When do I need a @Factory?

hexxter do-not-reply at jboss.com
Wed Aug 22 15:56:16 EDT 2007


Hi,

when I try to inject some SessionBean with

@In( create=true )
MySessonBean mySessionBean

a "could not set field value" Exception is thrown.

The documentation states that "If the context variable is null, an instance of the component is instantiated by Seam.". 

If I create a 
@Factory( "mySessionBean" ) 
public MySessionBean makeMySessionBean(){ return new MySessionBean(); }

The whole stuff works.

Am I doing something wrong? Or is the documentation wrong. When exactly do I need a @Factory?

Thanks,

Florian

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

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



More information about the jboss-user mailing list