This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JNDI  Lookup running on another Machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI  Lookup running on another Machine" Watch "JNDI  Lookup running on another Machine" New topic

JNDI Lookup running on another Machine

Murugan R

Joined: Aug 14, 2001
Posts: 1
I tried a sample ejb provided with the J2ee1.3 beta release
(the jms api and a jms server are included in j2ee1.3) using JRUN 3.1.
From the Client Side i have the code like:
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "allaire.ejipt.ContextFactory");
env.setProperty(Context.PROVIDER_URL, "ejipt://servername:2323");
env.setProperty(Context.SECURITY_PRINCIPAL, request.getParameter("User"));
env.setProperty(Context.SECURITY_CREDENTIALS, request.getParameter("Password"));
home =( Home )( javax.rmi.PortableRemoteObject.narrow( ( new InitialContext(env) ).lookup( "java:comp/env/ejb/beanname" ),Home.class);
When the servername is Localhost , it is working fine.
When i try to lookup a bean running on another machine, i m getting the error like:
JNDI lookup failed: javax.naming.CommunicationException: Can't find ServerName.
But the Server name is available. And it is Communicating well when i made DB access.
Could anyone help ?

[This message has been edited by Murugan R (edited August 14, 2001).]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17046

Try using the server's IP address instead. That is, replace "ejipt://servername:2323" with "ejipt://" (or whatever "servername"s IP is.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: JNDI Lookup running on another Machine
jQuery in Action, 3rd edition