title: javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - Object Class Violation];
body: <p>Here in this code, I am not able to add one user to group. Here uid is user. Here cn=citizens,cn=doit,o=evault is group Full DN and also instead of member I tried with memberOf. But still it is showing same Exception.</p>
  
  <pre><code>        Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY, initctx);
          env.put(Context.PROVIDER_URL, myhost);
          env.put(Context.SECURITY_PRINCIPAL, mgrdn);
          env.put(Context.SECURITY_CREDENTIALS, mgrpw);
          System.out.println("Connect");
          String entryDN = "uid=datta,cn=doit,o=evault";
  
          // entry's attributes
          BasicAttribute cn = new BasicAttribute("cn", "datta");
          BasicAttribute sn = new BasicAttribute("sn", "kumar");
          BasicAttribute mail = new BasicAttribute("mail", "sai@xx.com");
          BasicAttribute phone = new BasicAttribute("telephoneNumber", "9704763492");
          BasicAttribute uid = new BasicAttribute("uid", "datta");
          BasicAttribute member = new BasicAttribute("member", "cn=citizens,cn=doit,o=evault");
  
          BasicAttribute oc = new BasicAttribute("objectClass");
          oc.add("top");
          //oc.add("person");
          oc.add("groupOfNames");
  
          ((javax.naming.directory.Attribute) oc).add("organization");
         // ((javax.naming.directory.Attribute) oc).add("inetOrgPerson");
          ((javax.naming.directory.Attribute) oc).add("groupOfNames");
  
          DirContext ctx = new InitialDirContext(env);
  
          // build the entry
          BasicAttributes entry = new BasicAttributes();
          entry.put(cn);
          entry.put(sn);
          entry.put(mail);
          entry.put(phone);
          entry.put(uid);
          entry.put(member);
          entry.put(oc);
  
  
          // Add the entry
          ctx.createSubcontext(entryDN, (javax.naming.directory.Attributes) entry);
  </code></pre>
  
  <p>Here It showing error as :</p>
  
  <pre><code>javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - Object Class Violation]; remaining name 'uid=datta,cn=doit,o=evault'
  </code></pre>