On 12/5/11 7:40 AM, Christoph Czurda wrote:
Hi!

I have tried to connect to ApacheDS server using LDAP api. However I got
the following error:

Exception in thread "pool-16-thread-1"
java.lang.IllegalArgumentException: factory
        at
org.apache.mina.filter.codec.ProtocolCodecFilter.<init>(ProtocolCodecFilter.java:73)
        at
org.apache.directory.ldap.client.api.LdapNetworkConnection.<init>(LdapNetworkConnection.java:229)


The exception is thrown here:

LdapConnection connection = new LdapNetworkConnection( "localhost", 10389 );

What could be the problem?

It's a bit complicated. You need to have a ProtocolCodecFactory loaded before being able to instanciate the ProtocolCodecFilter class, and that means you must include the org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolCodecFactory class into your environment. This class is loaded using reflection, unless you specify another one, and it's present in the shared-ldap-net-mina jar.

Include it into your loaded bundles, and you should be fine (assuming ypu also have the bundles this bundle depends on present too.)


--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to