Hi,

I have created a standalone Apache DS Server (version 2.0.0-m6) which is
working fine

https://gist.github.com/cmoulliard/fbbdb7521104f3f23c27

but when a LDAP client (developed inside a class of Apache ActiveMQ project
- ) is doing some requests on the DirContext I get such class cast exception

CODE
=====
   protected void query() throws Exception {
        DirContext currentContext = open();

        final SearchControls constraints = new SearchControls();
        constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);

        DefaultAuthorizationMap newMap = new DefaultAuthorizationMap();
        for (PermissionType permissionType : PermissionType.values()) {
            try {
                processQueryResults(newMap,
                    currentContext.search(queueSearchBase,
getFilterForPermissionType(permissionType),
                    constraints), DestinationType.QUEUE, permissionType);
            } catch (Exception e) {
                LOG.error("Policy not applied!.  Error processing policy
under '{}' with filter '{}'", new Object[]{ queueSearchBase,
getFilterForPermissionType(permissionType) }, e);
            }
        }

ERROR
======

Thread-15 ERROR
[org.apache.activemq.security.SimpleCachedLDAPAuthorizationMap] - Caught
unexpected exception.
javax.naming.NamingException: [LDAP: error code 80 - OTHER: failed for
MessageType : SEARCH_REQUEST
Message ID : 11
    SearchRequest
        baseDn : 'ou=Temp,ou=Destination,ou=ActiveMQ,ou=system'
        filter : '(cn=read)'
        scope : whole subtree
        typesOnly : false
        Size Limit : no limit
        Time Limit : no limit
        Deref Aliases : deref Always
        attributes :
org.apache.directory.shared.ldap.model.message.SearchRequestImpl@291cd875
 OpaqueControl Control
        Type OID    : '2.16.840.1.113730.3.4.3'
        Criticality : 'true'
'
    OpaqueControl Control
        Type OID    : '2.16.840.1.113730.3.4.2'
        Criticality : 'false'
'
: org.apache.directory.shared.ldap.codec.BasicControlDecorator cannot be
cast to
org.apache.directory.shared.ldap.model.message.controls.PersistentSearch];
remaining name 'ou=Temp,ou=Destination,ou=ActiveMQ,ou=system'
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3179)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3081)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2888)
        at
com.sun.jndi.ldap.AbstractLdapNamingEnumeration.getNextBatch(AbstractLdapNamingEnumeration.java:148)
        at
com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:217)
        at
com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMore(AbstractLdapNamingEnumeration.java:189)
        at
com.sun.jndi.ldap.NamingEventNotifier.run(NamingEventNotifier.java:135)
        at java.lang.Thread.run(Thread.java:745)

Any idea bout how to avoid such error which is not blocking ?

Regards,

-- 
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to