[ 
https://issues.apache.org/jira/browse/DIRAPI-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14699261#comment-14699261
 ] 

Radovan Semancik commented on DIRAPI-244:
-----------------------------------------

There is method how to work around it. Initialize SchemaLoader and 
DefaultSchemaManager explicitly. Like this:

{code}
                        DefaultSchemaLoader schemaLoader = new 
DefaultSchemaLoader(connection, schemaQuirksMode);
                        DefaultSchemaManager defSchemaManager = new 
DefaultSchemaManager(schemaLoader);
                        try {
                                if (schemaQuirksMode) {
                                        defSchemaManager.setRelaxed();
                                        
defSchemaManager.loadAllEnabledRelaxed();
                                } else {
                                        defSchemaManager.loadAllEnabled();
                                }
                                } catch (Exception e) {
                                        throw new 
ConnectorIOException(e.getMessage(), e);
                                }
                        if ( !defSchemaManager.getErrors().isEmpty() ) {
                                if (schemaQuirksMode) {
                                        LOG.ok("There are {0} schema errors, 
but we are in quirks mode so we are ignoring them", 
defSchemaManager.getErrors().size());
                                } else {
                                        throw new ConnectorIOException("Errors 
loading schema "+defSchemaManager.getErrors());
                                }
                        }
{code}

see 
https://github.com/Evolveum/connector-ldap/blob/master/src/main/java/com/evolveum/polygon/connector/ldap/AbstractLdapConnector.java

The use the API in the schemaless mode. Whenever you need schema information 
then retrieve it from defSchemaManager explicitly. This works for me with 
OpenDJ, 389ds and eDirectory. Might work for you as well.

> Error in loading schema
> -----------------------
>
>                 Key: DIRAPI-244
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-244
>             Project: Directory Client API
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M31
>            Reporter: Steven Nguyen
>
> Hi Team,
> I have an issue in loading schema in LDAPNetworkConnection.
> I could connect to my Active Directory host, however when I call the 
> loadSchema() method, it threw out below exception
> java.text.ParseException: ERR_04228 Parser failure on attribute type 
> description: ( 1.2.840.113556.1.4.375 NAME 'systemFlags' SYNTAX 
> '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION ) Antlr 
> message: NO-USER-MODIFICATION requires an operational USAGE Antlr column: 0: 
> ERR_04228 Parser failure on attribute type description: ( 
> 1.2.840.113556.1.4.375 NAME 'systemFlags' SYNTAX 
> '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION ) Antlr 
> message: NO-USER-MODIFICATION requires an operational USAGE Antlr column: 0: 
> NO-USER-MODIFICATION requires an operational USAGE
> Could you please advise?
> Best Regards,
> Steven Nguyen



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to