Problems creating a root context using DirContext::createSubcontext
I am new to both JNDI and LDAP, and I am having a problem with the following basic JNDI code sample. When trying to create arootContext withctx.createSubcontext, an exception is thrown stating:
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - no global superior knowledge]; remaining name 'o=jndiTest'
What does this error mean?
finalstatic String ldapServerName ="backbone.seamonkey";
finalstatic String rootContext ="o=jndiTest";
publicstaticvoid main( String[] args )
{
// set up environment to access the server
Hashtable<Object,Object> env =new Hashtable<Object,Object>();
env.put( Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory" );
env.put( Context.PROVIDER_URL,"ldap://" + ldapServerName +":389/" );
try{
// obtain initial directory context using the environment
DirContext ctx =new InitialDirContext( env );
// now, create the root context, which is just a subcontext
// of this initial directory context.
ctx.createSubcontext( rootContext );
ctx.close();
}catch ( NameAlreadyBoundException nabe ){
System.err.println( rootContext +" has already been bound!" );
}catch ( Exception e ){
System.err.println( e );
}
}

