-
1. Re: EJB injection from web project
wdfink Dec 3, 2013 3:27 PM (in response to tizo)that should work, you might have a look to the ejb-multi-server quickstart. have a look to the main-app there is a web application and a ejb jar
-
2. Re: EJB injection from web project
tizo Dec 4, 2013 8:06 AM (in response to wdfink)As far as I can see, in that example the web project in app-main is accessing an EJB inside the same EAP. What we want to do, is to access some EJBs that are packaged in a different package of the web project.
-
3. Re: EJB injection from web project
wdfink Dec 4, 2013 8:58 AM (in response to tizo)1 of 1 people found this helpfulIf you look to the JsfController the AppOne AppTwo injections are EJB's deployed in a different application and server.
-
4. Re: EJB injection from web project
tizo Dec 5, 2013 7:36 AM (in response to wdfink)I managed to do it, but with the next annotation (being PruebasJbossEjbs-EAR the EAR project containing the EJB, PruebasJbossEjbs the EJB project, pruebas.Prueba1 the class implementing the bean, and pruebas.Prueba1Remote the bean's interface that is in another jar project imported by the EJB project):
@Resource(lookup = "java:global/PruebasJbossEjbs-EAR/PruebaJbossEjbs/Prueba1!pruebas.Prueba1Remote")
I took the parameter from the log when the EAR was deployed, something like:
09:47:36,539 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-10) JNDI bindings for session bean named Prueba1 in deployment unit subdeployment "PruebaJbossEjbs.jar" of deployment "PruebasJbossEjbs-EAR.ear" are as follows:
java:global/PruebasJbossEjbs-EAR/PruebaJbossEjbs/Prueba1!pruebas.Prueba1Remote
java:app/PruebaJbossEjbs/Prueba1!pruebas.Prueba1Remote
java:module/Prueba1!pruebas.Prueba1Remote
java:jboss/exported/PruebasJbossEjbs-EAR/PruebaJbossEjbs/Prueba1!pruebas.Prueba1Remote
java:global/PruebasJbossEjbs-EAR/PruebaJbossEjbs/Prueba1
java:app/PruebaJbossEjbs/Prueba1
java:module/Prueba1I don't know if this is the most correct way to do it, and it is not as straight as "@EJB" annotation without parameters in GlassFish, but It works for us.
Thanks very much Wolf-Dieter.