Deploy Remote EJB with @EJB Annotation

A simple question: when I deploy EJB on a specific application server and then I want to use it from EJB deployed on another application server (of course, of course), how can I introduce a remote instance of the previous EJB inside the second?

It should be something like this:

 @Stateless
 public class EJBClient {

   @EJB("myRemoteBean")
   static private MyBeanRemote bean;

   ... 
 }

But I would like to know: how to specify the JNDI properties (IP and so) of the first application server for the second to perform a search?

If there is no standard way to do this, JBoss servers.

+3
source share
1 answer

Well, firstly, I think there is confusion in your code. You should not use a static class annotated @Stateless.

-, EJBClient @Stateless?

, . Jboss EJB Context/EJB_Name/remote. Context - EAR, EJB, EJB_Name - , @Remote.

, .

, .

0

All Articles