-
15. Re: Session bean injection
sfcoy Jan 14, 2013 6:15 AM (in response to lafr)I guess it could be this:
{quote}
3.4.7.2 Stateless Session Beans
All business object references of the same interface type for the same stateless session bean have the same object identity, which is assigned by the container.
{quote}
-
16. Re: Session bean injection
nickarls Jan 14, 2013 6:17 AM (in response to sfcoy)There was a WELD message about unsatisfied deps so one would think that beans.xml is found.
-
17. Re: Session bean injection
sfcoy Jan 14, 2013 6:23 AM (in response to nickarls)That might be because it can't resolve a reference to the remote interface.
-
18. Re: Session bean injection
nickarls Jan 14, 2013 6:32 AM (in response to sfcoy)Ah. "Remote interfaces are not included in the set of bean types". Therefore there won't be one with @New, either.
-
19. Re: Session bean injection
sfcoy Jan 14, 2013 6:38 AM (in response to ran_inc)In summary, we expect the following should work:
{code:java}
@Inject @New
Instance<GeneralSessionLocal> generalSessionInstance;
{code}
-
20. Re: Session bean injection
nickarls Jan 14, 2013 6:42 AM (in response to sfcoy)Unless WELD-975 applies ;-)
-
21. Re: Session bean injection
sfcoy Jan 14, 2013 7:00 AM (in response to nickarls)Indeed. It looks like the fix became available in 7.1.3.Final.
-
22. Re: Session bean injection
nickarls Jan 14, 2013 8:39 AM (in response to sfcoy)One option could be dropping in a fresh weld implementation module and hold your breath, hoping the SPI hasn't changed.
-
23. Re: Session bean injection
ran_inc Jan 14, 2013 8:53 AM (in response to nickarls)when I do it with out the Instance -
@Inject
GeneralSessionLocal bs;
I get:
WELD-001443 Pseudo scoped bean has circular dependencies. Dependency path [Session bean [class com.windriver.dsm.labmanagement.ejb.session.GeneralSessionBean with qualifiers [@Any @Default]; local interfaces are [GeneralSessionLocal], Session bean [class com.windriver.dsm.labmanagement.ejb.session.GeneralSessionBean with qualifiers [@Any @Default]; local interfaces are [GeneralSessionLocal]]
-
24. Re: Session bean injection
nickarls Jan 14, 2013 9:53 AM (in response to ran_inc)Same with @Inject @New?
-
25. Re: Session bean injection
ran_inc Jan 14, 2013 10:30 AM (in response to ran_inc)I have no Idea what canged, but now somehow this works (I am pretty sure I tried it before with out the new annotaion):
@Inject
Instance<GeneralSessionLocal> generalSessionInstance;
and generalSessionInstance.get() returns an instance with no problem .
-
26. Re: Session bean injection
nickarls Jan 14, 2013 10:31 AM (in response to ran_inc)demo effect! ;-)