Jeffry Kristianto Yanuar wrote:Does the plain java class must be run on the same PC which is the server is running ?
You can lookup a EJB located on a remote server. The client need not be on the same server.
Jeffry Kristianto Yanuar wrote:
If we can do the lookup to JNDI server outside the PC which is the server is running, do we need the IP address of the server ?
The JNDI lookup usually looks like this:
In this case a file named jndi.properties is searched in the classpath to determine the "context" information which includes the server address.
You can even pass the server address in the code itself through a Properties parameter to the InitialContext
The
java.lang.InitialContext javadocs has good information