0

enter image description here

I have to send data from P1 et P2 and P3 till reaching the 4th machine P4 which contains 2 EJBs. I don't know how to send data from EJB3A to EJB3B. Can a server be a client too?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
fey
  • 3
  • 2

1 Answers1

0

The server can, of course, be a client, too.

I guess P3, in the end, is calling EJB3A. If EJB3A andEJB3B are deployed within the same JBoss server, you can use EJB injection to delegate to EJB3B or lookup the EJB. If EJB3B is deployed to another JBoss server instance, you have two options: if EJB3B is clustered, you can use injection or lookup like above. If not, you can still lookup EJB3B like an ordinary remote client would do, using the adress and port and the remote view of the other JBoss server and EJB.

Frito
  • 446
  • 2
  • 12
  • 'Properties props = System.getProperties(); props.put( Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); props.put( Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.intefaces"); props.put( Context.PROVIDER_URL, "jnp://localhost:1099"); Context ctx=new InitialContext(props); P3 op=(EJB3A) ctx.lookup("EJB3A/remote") ;' – fey Nov 13 '18 at 17:04
  • so in p3 i will have this code above ! to lookup for EJB3A then EJB3A will have to same code to lookup for ejb3b ( ejb3a will have to send data to ejb3b how can i do that plz ? thank you – fey Nov 13 '18 at 17:06