Active Directory LDAP server to Store Java Objects RRS feed

  • Question

  • I am using Active Directory LDAP server (AD LDS Instance) locally to store objects and lookupthem. I am able to create default objects using the Java Code given below                                                                                            

      void create ()
           Hashtable hash = new Hashtable();
           hash.put (Context.INITIAL_CONTEXT_FACTORY," com.sun.jndi.ldap.LdapCtxFactory");
           hash.put (Context.PROVIDER_URL, "ldap://,C=US");
           hash.put (Context.SECURITY_PRINCIPAL, "CN=SuperUser,O=Fiorano,C=US");
           hash.put (Context.SECURITY_CREDENTIALS, "password");
           DirContext m_dirContext = new InitialDirContext (hash);
           System.out.println("InitialDirContext successfully created");

    BasicAttribute objClasses = new BasicAttribute("objectclass"); 

    BasicAttributes attrs = new BasicAttributes();
    attrs.put("telephonenumber", "1-800-use-LDAP");
    m_dirContext.bind("CN=Gobi",null, attrs); // Working fine
    catch(Exception e)


    In the bind() funtion When i try to provide any Java Object it is unable to bind/create the corresponding object in AD LDS insatnce.

    like below

    Object Obj = "MyTopic";

    m_dirContext.bind("CN=MyTopic",obj, attrs); // Not Working

    For this I have to update my ADLDS to provide support for Storing Java Objects. I cant find any good link to update my AD LDS schema to provide Java Objects support. Please help me.

    Friday, August 1, 2014 2:06 PM


  • Hi,

    This forum is used to discuss the questions about the Windows Communication Foundation, Serialization, and Networking, then for your question it will be better for you to post it to the Active Directory and LDAP forum.

    #Active Directory and LDAP Forum: .

    Thanks for your understanding.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 4, 2014 11:15 AM