Solved

Where to download tiny LDAP server for window to test JNDI programs?

Posted on 2002-07-13
8
1,346 Views
Last Modified: 2013-11-24
Dear experts,
  I want to download a tiny/free LDAP server for window version to test my own JNDI programs. But I've no idea where can I download it. Please tell me where can I download it. If possible, can you teach me how to configure it ?

Thank you. :)
0
Comment
Question by:JavaSlave
8 Comments
 
LVL 5

Expert Comment

by:fontaine
ID: 7151425
http://www.eudora.com/free/ldap.html

I have never used it, however.
0
 
LVL 3

Expert Comment

by:gandalf94305
ID: 7151660
I recommend OpenLDAP from http://www.openldap.org/

Check out the web site, it has examples and the LDAP server itself is relatively easy to configure. HOWEVER, don't expect this to be as easy as running a setup.exe and defining a database table or two. Before doing this, read about the basics of LDAP. You'll find that information on the OpenLDAP site, too.

If you don't want to set up your own LDAP service, try accessing one of the public servers. There are a few lists around, e.g., http://www.emailman.com/ldap/public.html

So, for testing purposes, if you don't have to use specific schema extensions, use one of the public servers. Otherwise, read a bit more and try your luck with OpenLDAP.

Cheers,
--gandalf.
0
 

Author Comment

by:JavaSlave
ID: 7151849
Sorry gandalf94305,
  I can't find any window version from the website..

  My main purpose is that i want to define a JDBC source name, and use JNDI to get JDBC connection from the source though some LDAP service provider. Can I define it in those global LDAP server?

  Please advice me about this topice. Thank..
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 5

Expert Comment

by:fontaine
ID: 7152115
As far as I know about, OpenLDAP is only available for UNIX systems, indeed.
0
 
LVL 3

Expert Comment

by:gandalf94305
ID: 7152147
OpenLDAP is indeed available on Windows. Check out http://www.fivesight.com/downloads/openldap.asp (also mentioned in the FAQ). Compile it yourself or simply download the binaries.

In my opinion, if you want to play with a serious LDAP server, this is probably the best free one around, able to take it up with many commercial servers.

With JNDI, you would use something like this:

  private DirContext theContext = null;
  private Object lock = new Object();

  protected static String MY_INITIAL_CONTEXT_FACTORY =
    "com.sun.jndi.ldap.LdapCtxFactory";

  protected DirContext initializeLDAP(Hashtable config) {

    if (!config.get("ldap.keepalive.context").equals("yes")) {
      return initializeLDAP_newContext(config);
    }

    if (theContext == null) {
      synchronized (lock) {
     if (theContext == null) {
       theContext = initializeLDAP_newContext(atoms);
     }
      }
    }
    return theContext;
  }

  private DirContext initializeLDAP_newContext(Hashtable config) {
    DirContext context = null;
    Hashtable env = new Hashtable(11);

    // java.naming.factory.initial
    env.put(Context.INITIAL_CONTEXT_FACTORY, MY_INITIAL_CONTEXT_FACTORY);
   
    // java.naming.provider.url
    env.put(Context.PROVIDER_URL, config.get("ldap.service"));

    // java.naming.security.authentication
    // -  CRAM-MD5, none, simple, strong
    env.put(Context.SECURITY_AUTHENTICATION, config.get("ldap.authentication"));
   
    // java.naming.security.principal
    // -  dname of the principal to be authenticated
    //env.put(Context.SECURITY_PRINCIPAL, "");

    // java.naming.security.credentials
    // -  credentials for the principal according to the
    //    selected authentication scheme.
    // env.put(Context.SECURITY_CREDENTIALS, "");

    // java.naming.security.protocol
    // env.put(Context.SECURITY_PROTOCOL, "ssl");

    // java.naming.ldap.version
    // env.put("java.naming.ldap.version", "3");

    // Get a handle to an initial directory context
    try {
      context = new InitialDirContext(env);
    } catch (NamingException e) {
      // Log.error(HERE, "cannot initialize LDAP", e);
    }
    return context;
  }

You simply use LDAP v2/v3 to connect to the LDAP server, no JDBC involved here directly. For even more sample code, go to places like http://www-unix.mcs.anl.gov/~chen/talks/jndi-ldap/5.html

One other tool you may find interesting is Softerra's LDAP browser: http://www.ldapadministrator.com/

--gandalf.
0
 

Expert Comment

by:ReRun07
ID: 7764818
One of my developers wants to know how much data a keepalive for LDAP produces?  Basically, he wants to know if we have we should keep a connection open to an LDAP server or close it after each use.  I hope this is enough information.
0
 
LVL 5

Expert Comment

by:vemul
ID: 7887917
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points not refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 7959649
Question placed in PAQ

Computer101
E-E Admin
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 53
Checkbox and ListView in Android Layout 4 65
Java DateChooser? 3 36
Is there a simpler dropbox system? 10 22
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question