Solved

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

Posted on 2002-07-13
8
1,338 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
 
LVL 5

Expert Comment

by:fontaine
ID: 7152115
As far as I know about, OpenLDAP is only available for UNIX systems, indeed.
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 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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

896 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now