This content has been marked as final.
Show 6 replies
-
1. Re: Problem with session bean
wilczarz.wilczarz.gmail.com Sep 23, 2008 12:12 PM (in response to bard123)All you need is @In annotation. Check out the bijection pattern in Seam reference.
-
2. Re: Problem with session bean
bard123 Sep 23, 2008 12:44 PM (in response to bard123)If I put @In, there is an error when deploying:
java.lang.RuntimeException: Could not create Component: monsessionBean
-
3. Re: Problem with session bean
andre.eugenio Sep 23, 2008 1:23 PM (in response to bard123)It's easier to help if you provide some code, but perhaps you just need to use @AutoCreate
-
4. Re: Problem with session bean
bard123 Sep 23, 2008 3:08 PM (in response to bard123)Here is my code
@Stateful @Name("sessionBean1") public class SessionBean1 implements interfaceSessionBean1{ @In(create=true, value="sessionBean2") SessionBean2 sessionBean2 public sessionBean1(){ sessionBean2.initialiser(); } }
@Stateful @Name("sessionBean1") public class SessionBean2 implements interfaceSessionBean2{ public sessionBean2(){ } public void initilisaer(){ system.err.println("initialisation !!! "); } }
but there is an error when deploying
-
5. Re: Problem with session bean
wilczarz.wilczarz.gmail.com Sep 23, 2008 3:23 PM (in response to bard123)You have duplicate component names:
sessionBean1
-
6. Re: Problem with session bean
andre.eugenio Sep 23, 2008 4:14 PM (in response to bard123)and i miss @Scope(ScopeType.Session) to make the bean act in session scope to seam (sorry if @Statefull to this because i really dont know about ejb3)