You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Erdal Karaca <er...@googlemail.com> on 2009/04/15 11:36:31 UTC

Usage of ldap connection.core in custom rcp

I am using the "org.apache.directory.studio.connection.core" plugin (and its
dependencies) in a custom rcp.

There are valid ldap connections configured (using the "New Connection"
wizard).

Now, when trying to use a ldap connection (connection obtained from
connection manager of connection.core),
there is always an error when connection is bound:

javax.naming.NamingException: No authentification handler
 at
org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.doBind(JNDIConnectionWrapper.java:926)
 at
org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.bind(JNDIConnectionWrapper.java:206)

When "org.apache.directory.studio.connection.ui" is loaded just before
JNDIConnectionWrapper.bind() is called, this error will not occur.

It seems that connection.core somehow depends on connection.ui.

So, what is the preferred way of using just the core plugins without ui?

Re: Usage of ldap connection.core in custom rcp

Posted by Erdal Karaca <er...@googlemail.com>.
Thanks for the answer!

The user settings are persisted in connections.xml in the workspace.
Maybe, the core IAuthHandler should try to read those settings, first...

Just because you asked: I am using the connection sub-component to
synchronize personal user data from an enterprise ldap server with a
database user table...

2009/4/15 Stefan Seelmann <se...@apache.org>

> Hi Erdal,
>
> Quoting Erdal Karaca <er...@googlemail.com>:
>
>  Now, when trying to use a ldap connection (connection obtained from
>> connection manager of connection.core),
>> there is always an error when connection is bound:
>>
>> javax.naming.NamingException: No authentification handler
>>  at
>> It seems that connection.core somehow depends on connection.ui.
>>
>> So, what is the preferred way of using just the core plugins without ui?
>>
>>  You are right. The connection UI plugin injects some dependencies to the
> core plugin.
>
> You need to implement your own IAuthHandler and set it via
> ConnectionCorePlugin.setAuthHandler(), see the UIAuthHandler class for an
> example. The purpose of this handler is to ask the user for the password if
> the password isn't saved in the connection properties.
>
> Maybe it makes sense to set a default IAuthHandler in the core plugin, that
> throws an exception if no password is available. This default could then be
> overwritten by the UI plugin. Any contribution is welcomed :-)
>
> The same should be done for the IReferralHandler, this is used to ask the
> user for the target connection of an referral.
>
> Kind Regards,
> Stefan
>
> BTW: I'm just curious: What kind of custom RCP application are you working
> on, if you could talk about?
>
>
>

Re: Usage of ldap connection.core in custom rcp

Posted by Stefan Seelmann <se...@apache.org>.
Hi Erdal,

Quoting Erdal Karaca <er...@googlemail.com>:

> Now, when trying to use a ldap connection (connection obtained from
> connection manager of connection.core),
> there is always an error when connection is bound:
>
> javax.naming.NamingException: No authentification handler
>  at
> It seems that connection.core somehow depends on connection.ui.
>
> So, what is the preferred way of using just the core plugins without ui?
>
You are right. The connection UI plugin injects some dependencies to  
the core plugin.

You need to implement your own IAuthHandler and set it via  
ConnectionCorePlugin.setAuthHandler(), see the UIAuthHandler class for  
an example. The purpose of this handler is to ask the user for the  
password if the password isn't saved in the connection properties.

Maybe it makes sense to set a default IAuthHandler in the core plugin,  
that throws an exception if no password is available. This default  
could then be overwritten by the UI plugin. Any contribution is  
welcomed :-)

The same should be done for the IReferralHandler, this is used to ask  
the user for the target connection of an referral.

Kind Regards,
Stefan

BTW: I'm just curious: What kind of custom RCP application are you  
working on, if you could talk about?