How to inject remote EJBs using @EJB annotations
Issue
- In the case of EJBs deployed on separate instances of EAP is it possible to establish a reference using annotations, irather than old-fashioned JNDI way using the InitialContext class?
- We are referencing EJB deployed in different EAR using Local interface. We have to different modules deployed seperately, packaged as EARs. One of the modules needs to inject an EJB from the other module. So far we can only get this working by referencing the remote interface of the EJB using the @EJB annotation with the mappedname attribute set. Is this the intended approach, or is there an approach we are missing for how to do this.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
