users@glassfish.java.net

javax.naming.CommunicationException on jndi lookup

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 Jan 2009 07:24:02 PST

Hi,

I am using Glassfish 9.1 update 2 server and have a EJB 3 bean with remote interface. A client deployed in the Application client works perfectly fine.

I wanted to reach the bean from remote machines. Hence I wrote JNDI code to build the context with the Environment. I studied that the Application vendor publishes on how remote clients can communicate to the server. I referred http://docs.sun.com/app/docs/doc/819-3658/ablky?a=view and try to put a LDAP factory mentioned and the URL. But both these settings have burst to error, telling client is not able to reach the server's JNDI service.

May I detail on only the important lines of my client code.
..... prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
prop.put(Context.PROVIDER_URL,"ldap://localhost:389/o=myObjects");
.....
Object obj = context.lookup("IAmMappedBidManagerBean");
....

The exception is
javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused: co
nnect]
Do I have to run any LDAP server or orb service in the server machine?
How to solve the problem of communication.

Your help will be very useful.

Regards,
Rajesh
[Message sent by forum member 'rajesh_s' (rajesh_s)]

http://forums.java.net/jive/thread.jspa?messageID=324078