Advertisement

06.27.2008 at 08:19AM PDT, ID: 23521928
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Problem updating ADAM Schema using a Java program

Asked by bganoush in Java Programming Language, Active Directory

Tags: ,

Hi,

My name is Nick and my friend bganoush has been nice enough to let me use his account to ask for some help in here.

Some background info first. I have access to a windows 2003 server where ADAM (active directory application mode) is installed. I installed a new ADAM instance on this server and created an application partition called o=JNDITutorial. This ADAM instance is setup to run as a network service and the administrator for this instance is my account on the server itself. Inside this application partition I also created an organizational unit ou=LDAPUsers. I then added a user to this ou, CN=Nick,OU=LDAPUsers,O=JNDITutorial and enabled the account and set a valid password. From there I added this ADAM user to the Administrator group/role that is already defined in the ADAM schema. I'm thinking this user Nick should now have full administrative rights within the ADAM instance.

What I want to do know is extend the ADAM schema so that I can store Java objects in the directory.
I've been reading this tutorial http://java.sun.com/products/jndi/tutorial/trailmap.html
In the preparations section is a Java program that will connect to the LDAP server and create the necessary schema classes so that the directory can store Java objects. The program can be found here
http://java.sun.com/products/jndi/tutorial/config/LDAP/CreateJavaSchema.java
The attributes and classes I am trying to add so that the directory supports Java objects can be found here, http://java.sun.com/products/jndi/tutorial/config/LDAP/java.schema

I modified the program by hardcoding my server url in along with the username and password for the user CN=Nick,OU=LDAPUsers,O=JNDITutorial.
The program connects to the ADAM server perfectly but then fails when it tries to update the schema. Here is the exception that is thrown,

[updating Active Directory schema ...]
[locating the schema]
[inserting new attribute definitions ...]
javax.naming.NoPermissionException: [LDAP: error code 50 - 00000005: SecErr: DSID-031520D9, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0
]; remaining name 'cn=javaClassName'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(Unknown Source)
at CreateJavaSchema.insertADAttributes(CreateJavaSchema.java:498)
at CreateJavaSchema.updateADSchema(CreateJavaSchema.java:438)
at CreateJavaSchema.updateSchema(CreateJavaSchema.java:211)
at CreateJavaSchema.run(CreateJavaSchema.java:109)
at CreateJavaSchema.main(CreateJavaSchema.java:97)

The exception is thrown when it tries to create the very first attribute. I think it's telling me the user I supplied doesn't have sufficient rights to modify the schema. I thought this would work given that the user I created has been added to the Administrators role/group within the ADAM instance.

I am a seasoned Java developer but this is my first stab at LDAP and using ADAM. I am rather disappointed with the lack of documentation out there on ADAM. Most of it gives the basics and assumes you have worked with Active Directory before. So finding help on how to update the Schema using this Java program has been frustrating.

I appreciate any help anyone can provide,

Thanks,
NickStart Free Trial
 
Loading Advertisement...
 
[+][-]06.29.2008 at 08:41AM PDT, ID: 21894367

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 11:09AM PDT, ID: 21901484

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:13PM PDT, ID: 21902651

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:22AM PDT, ID: 21917306

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Programming Language, Active Directory
Tags: Java, ADAM Schema Changes
Sign Up Now!
Solution Provided By: bganoush
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628