I am trying to connect LDAP through java code but getting the following Exception. Can anybody tell me what I am missing? Here is my code-
initialProperties = new Properties();
initialProperties.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
initialProperties.put(Context.PROVIDER_URL, providerURL);
initialProperties.put(Context.SECURITY_PRINCIPAL, securityPrincipal);
initialProperties.put(Context.SECURITY_CREDENTIALS, securityCredentials);
initialProperties.put(Context.SECURITY_AUTHENTICATION, authentication);
try {
context = new InitialDirContext(initialProperties);
}
catch(Exception e)
{e.printStackTrace();}
java.net.ConnectExceptionshould be your first clue:Signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the connection was refused remotely