Jndi Provider Url not working
Hi,
I got the following exception message when i run the given JNDI example on Sun Java Application Server8.1.
Please help me in resolving this issue;
Exception:
javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused: connect]
import javax.naming.*;
import java.util.*;
public class JndiExample {
public static void main(String[] args) {
try{
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
props.put(Context.PROVIDER_URL,"ldap://localhost:389");
Context ctx = new InitialContext(props);
}catch(Exception ex) { ex.printStackTrace();}
}

