You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Manish Kutaula <ma...@tcs.com> on 2011/05/18 08:08:56 UTC

Apacheds crashed after schema changes

I am using this program to add new attribute and class in the apacheds 
schema. 

public class CreateObjectClass {
         public static void main(String[] args) throws NamingException
            {   Properties env = new Properties(); 
                env.put(DirContext.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory"); 
                env.put(DirContext.PROVIDER_URL,"ldap://localhost:10389");
                env.put(DirContext.SECURITY_AUTHENTICATION, "simple");
                env.put(DirContext.SECURITY_PRINCIPAL, 
"uid=admin,ou=system");
                env.put(DirContext.SECURITY_CREDENTIALS, "secret"); 
                //env.put(DirContext.SECURITY_PRINCIPAL, "cn=admin,ou
=people");
                //env.put(DirContext.SECURITY_CREDENTIALS, "secret");  
                System.out.println("Connection successful!");
                DirContext ctx = new InitialDirContext(env);

              Attributes atAttrs = new BasicAttributes(true);
                atAttrs.put("attributeTypes", "( 
2.25.128424792425578037463837247958458780603.14 NAME 'secret' DESC 'Value 
of secret answer' EQUALITY caseIgnoreMatch SUBSTR 
caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 
SINGLE-VALUE )");
                ctx.modifyAttributes("cn=schema", DirContext.ADD_ATTRIBUTE
, atAttrs);

                Attributes ocAttrs = new BasicAttributes(true);
                ocAttrs.put("objectClasses", "( 
2.25.128424792425578037463837247958458780603.16 NAME 'userperson' DESC 
'customized class ' SUP inetOrgPerson STRUCTURAL MAY (secret) )");
                ctx.modifyAttributes("cn=schema", DirContext.ADD_ATTRIBUTE
, ocAttrs);
            }

but after running the program and restarting the server to see the 
affected changes in the schema, the server gets crashed with "Error 1067: 
process terminated unexpectedly and it doesnot start". The server is not 
starting again and i have to reinstall it.

I cannot figure out what is going wrong? Any ideas?

Manish Kutaula
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you