directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sahul <vsahu...@gowebtop.com>
Subject Please help me on ldap jndi programming
Date Tue, 18 Aug 2009 14:26:07 GMT

Hello one and All.... 

I am new to ldap programming. I am using Apache Directory server. I have to
insert organization information in apache directory server using jndi 

from java application. I able to insert the cn node from java application.
If I try to insert organization or organization unit level node from java 

application schema violation error is comming. Please tell me the code to
insert organization node from java application. Please help me. very 

Urgent. 
    
If this is the wrong place to post this question atleast please tell me the
forum topic where i need to post this question....
And  my code is



public class JndiAppOne 
	{
		public static void main(String[] args) 
		{
			Hashtable env=JndiProps.setJndiProps();
			try 
			{
				Context ctx = new InitialContext(env);
				ctx.bind("cn=NUM337,o=mst,ou=system",new Integer(49));
		        ctx.bind("cn=userinfo420,o=mst,ou=system",new
User("testname4","testdept4"));
				ctx.close();
			} 
			catch (NamingException e) 
			{
			      System.out.println(">>>>>>Operation failed: " + e);
			      e.printStackTrace();
			}
		}




The above code is working fine.

The bind statement in the above code creates a node cn=num337 under the
o=mst organization node.
I mannually created the o=mst organization level node from ApacheDS
studio(ldap client).

Problem I am facing:

when i try to add o=mst organization node from java applicatin schema
violation exception is comming the code is given below

ctx.bind("o=MMMMM,ou=system",new User("aaaa","mmmmm"));
javax.naming.directory.SchemaViolationException: [LDAP: error code 65 -
OBJECT_CLASS_VIOLATION: failed for     Add Request]



Please help me..very urgent.. I have to create an organization information
in ApacheDS from java application
-- 
View this message in context: http://www.nabble.com/Please-help-me-on-ldap-jndi-programming-tp25026099p25026099.html
Sent from the Apache Directory Project mailing list archive at Nabble.com.


Mime
View raw message