Issue Details (XML | Word | Printable)

Key: DIRSERVER-320
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Alex Karasulu
Reporter: Stefan Zoerner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Fetching the schema fails on some LDAP clients

Created: 17/Aug/05 09:03 PM   Updated: 10/Feb/06 12:34 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch_schemaFetch.txt 2005-08-18 04:04 AM Stefan Zoerner 1.0 kB
Java Source File RequiredAttributesForAnEntry.java 2005-08-17 09:16 PM Stefan Zoerner 1 kB

Resolution Date: 23/Aug/05 03:29 AM


 Description  « Hide
Fetching the schema fails on some LDAP clients I tried. Some others are able to retrieve a subset of the schema. E.g. Softerra LDAP Adminstrator displays some object classes, some are missing (for instance top, inetOrgPerson). Therefore the creation of entries by some GUI clients may not work (e.g. if the client provides support by displaying required and optional attributes). This is especially true for Softerra.

I am not 100% sure, but I assume the problem lies in in the textual respresentation of schema elements in the schema subentry. Here is an example:

Objectclass "top" looks to client like this for Apache DS:
( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' STRUCTURAL MUST objectClass MAY )
and like this for another server I checked:
( 2.5.6.0 NAME 'top' DESC 'Standard LDAP objectclass' ABSTRACT MUST objectClass X-ORIGIN 'RFC 2256' )

I guess some tools have problems with the empty "MAY". The same is probably true for empty "MUST" parts. Therfore inetOrgPerson does not appear in Softerra, but person does (person has both MAY and MUST attributes).

The problen does not only occur in some GUI clients, but also in JNDI code, if you use the schema functionality (for many of your users this may be more critical). You find a JNDI example attached to this issue report which crashes an Apache DS but runs without problems on other solutions. Maybe the JNDI parser has the same problem with empty MUSTs and MAYs. Problem is comparable, e.g. fetching "top" causes an exception, "person" does not.

Btw.: Within the JXplorer client there are no problems.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Stefan Zoerner added a comment - 17/Aug/05 09:16 PM
This little JNDI program displays the required attributes for an objectclass including those inherited by parent classes.
It uses JNDI schema fetching functionality. You may use it to confirm the problem with Apache DS I filed.

For another LDAP server output for "person" looks like this (the program fetches person and top):
person requires sn
person requires cn
top requires objectClass

On Apache DS it creates an Exception (on the client), output looks like this:
person requires sn
person requires cn
javax.naming.NameNotFoundException: top
at com.sun.jndi.toolkit.dir.HierMemDirCtx.doLookup(HierMemDirCtx.java:109)
at com.sun.jndi.toolkit.dir.HierMemDirCtx.getAttributes(HierMemDirCtx.java:464)
at com.sun.jndi.toolkit.dir.HierMemDirCtx.getAttributes(HierMemDirCtx.java:459)
at schematest.RequiredAttributesForAnEntry.main(RequiredAttributesForAnEntry.java:25)

Stefan Zoerner made changes - 17/Aug/05 09:16 PM
Field Original Value New Value
Attachment RequiredAttributesForAnEntry.java [ 12311787 ]
Stefan Zoerner added a comment - 18/Aug/05 04:04 AM
I modified the checks in class org.apache.ldap.common.schema.SchemaUtils which determine whether the MAY and MUST sets of attributes are empty (two lines, see patch-file attached).
 
Now all the GUI clients I have and even th JNDI program I attached some hours ago work properly. Therefore you may consider to apply it to your code.

Stefan Zoerner made changes - 18/Aug/05 04:04 AM
Attachment patch_schemaFetch.txt [ 12311802 ]
Alex Karasulu added a comment - 23/Aug/05 02:12 AM
I applied your patch stefan thanks. However there are other issues which I am still tracking down with this issue. Name the fact that the top objectClass is listed as STRUCTURAL when it should be ABSTRACT. For some reason the schema generation plugin is not properly generating the objectClass for TOP. Perhaps this is systemic. Regardless I'll resolve this issue, rebuild the jars, and deploy them once I get to the bottom of these problems.

 

Alex Karasulu added a comment - 23/Aug/05 03:29 AM
Committed changes to fix the objectClass type in revision 239213. Turns out all the ObjectClasses were defaulting to STRUCTURAL. This is now fixed and the proper objectClass type values i.e. STRUCTURAL, ABSTRACT, AUXILIARY should not appear correctly.

Alex Karasulu made changes - 23/Aug/05 03:29 AM
Fix Version/s 0.9.2 [ 12310192 ]
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Stefan Zoerner added a comment - 31/Aug/05 05:22 AM
I have retested the user experience on the current ApacheDS with the schema browser from Softerra. I also used some JNDI test cases that fetch schema information via API calls. Tada -- everything works like I would expect. It even provides the correct class types, Alex mentioned. And so I am happy and close this issue.

Stefan Zoerner made changes - 31/Aug/05 05:22 AM
Status Resolved [ 5 ] Closed [ 6 ]
Alex Karasulu made changes - 10/Feb/06 12:34 PM
Affects Version/s 0.9.2 [ 12310192 ]
Project Directory Server [ 10516 ] Directory ApacheDS [ 12310260 ]
Fix Version/s 0.9.2 [ 12310192 ]
Key DIREVE-227 DIRSERVER-320