Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI Lookup running on another Machine

 
Murugan R
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using the server's IP address instead. That is, replace "ejipt://servername:2323" with "ejipt://192.168.1.213:2323" (or whatever "servername"s IP is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic