-
1. Re: EJB-Injection from JSF in JBoss 4.2.2
maxlamenax Jun 9, 2009 4:06 AM (in response to nschweig)Hello,
For the first question on how to integrate an external project to a current project in Eclipse, it' simple !
Just click on the project, where the link with the EJB project is not done.
Click right, and choose something like this "update or change or modify build path" and go to the panel "project", in this panel click "add", and add a link to an another project in Eclipse, here, your EJB project ...
After this done, the autocorrection will accept, the call of the bean in the current project.
For the second point, i a m trying too to do Injection or link to a session bean EJB3 (facade or session) in a JSF view, but i have still even problem ...
Tell me if you know how to do ! -
2. Re: EJB-Injection from JSF in JBoss 4.2.2
nschweig Jun 9, 2009 4:44 AM (in response to nschweig)Hi,
I now work with JBoss 5 but I thinks the following is the solution for 4.2.2 If you have any problems with that please ask again.
in EJB "ShopWebSiteBean":public @Stateless class ShopWebSiteBean implements ShopWebSite { public static final String RemoteJNDIName = ShopWebSiteBean.class.getSimpleName() + "/remote"; ..}
from JSF-ManagedBean: "ShopBean":private ShopWebSite getShopWebSiteBean() { try { InitialContext ctx = new InitialContext(); return (ShopWebSite) ctx.lookup("ShopWebSiteBean/remote"); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("couldn't lookup ShopWebSiteBean", e); } }
Hope it helps,
NSchweig -
3. Re: EJB-Injection from JSF in JBoss 4.2.2
wolfgangknauf Jun 9, 2009 5:28 AM (in response to nschweig)Hi,
injection into JSF managed beans works in JBoss 4.2.3 and 5.0. So an "@EJB" annotation should be enough. This will only fail if the JSF implementation is not the one bundled with JBoss.
Best regards
Wolfgang