Hot Downloads

Welcome, Guest
Username: Password: Remember me


JAVA and LDAP 12 years 3 months ago #12867

Operating system: Windows XP
Problem: I want to connect to an LDAP.
Errors : Connexion passée
Exception in thread "main" Search......
javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C0905FF, comment: In order to perform
this operation a successful bind must be completed on the connection., data 0, vece

Code of aplication :

import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
public class LdapClient {
//Connéxion avec l'annuaire LDAP***********************************************************
private DirContext context;
public LdapClient() throws NamingException
context = getContext();
private DirContext getContext() throws NamingException
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "ldap://");
env.put(Context.SECURITY_AUTHENTICATION, "none");
System.out.println("Connexion passée");
return new InitialDirContext(env);
//Fin de Connéxion*************************************************************************

//Récupérer les informations d'un utilisateur**********************************************
public Attributes getUserAttributes(String username)
throws NamingException
SearchControls ctls = new SearchControls();
String filter = "uid=" + username;
NamingEnumeration answer;
String Name = ",uid=y.moufak";
answer =, filter, ctls);
while (answer != null && answer.hasMoreElements())
SearchResult sr = (SearchResult);
return sr.getAttributes();
throw new RuntimeException();
//Fin de la récuperation*******************************************************************

public static void main(String[] args) throws NamingException
//String username = args[0];
//String password = args[1];
LdapClient ldap = new LdapClient();

System.out.println("User : " + ldap.getUserAttributes("y.moufak"));

The administrator has disabled public write access.

Re: JAVA and LDAP 12 years 3 months ago #12877

  • drizzle
  • drizzle's Avatar
  • Offline
  • Distinguished Member
  • Posts: 138
  • Karma: 0
From the output, it looks like you are not binding to your LDAP server. What java app are you using? What LDAP server are you using. They all speak differently. Are you binding to OpenLDAP, Fedora/Netscape Directory Server, eDirectory, Active Directory (which can really be a pain)?

The administrator has disabled public write access.

Post 12 years 3 months ago #12881

I post to an active directory. i develop with eclipse.
Problem : The connection bind , but on the level of research I cannot.
The administrator has disabled public write access.
Time to create page: 0.116 seconds


Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V


  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup