File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Calling EJB from a different Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Calling EJB from a different Server" Watch "Calling EJB from a different Server" New topic

Calling EJB from a different Server

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Can someone plz tell me how to make call to the EJB from a different server. I have two machines both with App Server running on. Want to call an EJB hosted on machine A from machine B. No clusters, just independant servers on a network.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
The only difference to using an EJB from the same server, you need to obtain a remote JNDI context instead of doing "new InitialContext()".

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Hari babu
Ranch Hand

Joined: Jun 25, 2001
Posts: 208
In continuatation with the above post, My EJB "b" is deployed only on server B, and there is no mention of the EJB classes "b" in my server "A" (in A's classpath) and now the server A has to download the class files (class files of Bean "b") from server "B", for this to happen do i need to set anything special in my classpath as we do it in RMI for dynamic loading of classes ?
I agree. Here's the link:
subject: Calling EJB from a different Server
It's not a secret anymore!