directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Czurda <hasnoadditi...@gmail.com>
Subject Re: connection.exists(Dn) is false although entry exists
Date Wed, 01 Feb 2012 13:14:34 GMT
Yes, maybe it's just a version issue. Anyway, thank you for your effort.
I will fetch the latest versions later and then report back.

Kind regards,
Christoph

On 02/01/2012 01:55 PM, Pierre-Arnaud Marcelot wrote:
> Thanks.
> 
> I deleted my branch and imported yours from the LDIF.
> 
> Everything works as expected.
> 
> Here's my testing Main class:
>> import java.io.IOException;
>>
>> import org.apache.directory.ldap.client.api.LdapConnectionConfig;
>> import org.apache.directory.ldap.client.api.LdapNetworkConnection;
>> import org.apache.directory.shared.ldap.model.exception.LdapException;
>> import org.apache.directory.shared.ldap.model.name.Dn;
>>
>>
>> public class Main
>> {
>>     public static void main( String[] args ) throws LdapException, IOException
>>     {
>>         String dnString = "cn=testAttribute,ou=attributes,cn=testUser,ou=users,ou=userdata,dc=openengsb,dc=org";
>>         Dn dn = new Dn( dnString );
>>
>>         LdapConnectionConfig config = new LdapConnectionConfig();
>>         config.setLdapHost( "localhost" );
>>         config.setLdapPort( 10389 );
>>         config.setName( "uid=admin,ou=system" );
>>         config.setCredentials( "secret" );
>>
>>         LdapNetworkConnection connection = new LdapNetworkConnection( config );
>>
>>         connection.bind();
>>
>>         System.out.println( connection.exists( dnString ) );
>>         System.out.println( connection.exists( dn ) );
>>         System.out.println( connection.exists( dn.getName() ) );
>>         
>>         connection.close();
>>     }
>> }
> 
> That's really weird you're getting an error.
> 
> In my testing environment I'm using both trunk versions of API/Shared and ApacheDS.
> Maybe there was a bug in previous versions and it got fixed in between…
> 
> Regards,
> Pierre-Arnaud
> 
> On 1 févr. 2012, at 13:42, Christoph Czurda wrote:
> 
>> Here it is.
>> Thank you,
>> Christoph
>>
>> On 02/01/2012 01:29 PM, Pierre-Arnaud Marcelot wrote:
>>> Thanks.
>>>
>>> It's funny, but I really can't replicate the issue.
>>>
>>> When I use these three ways to access the information, they all succeed and print
"true":
>>>> System.out.println( connection.exists( dnString ) );
>>>> System.out.println( connection.exists( dn ) );
>>>> System.out.println( connection.exists( dn.getName() ) );
>>>
>>>
>>> Could you also attach the LDIF of the 'dc=openengsb,dc=org' branch please?
>>> Maybe I'm missing something here...
>>>
>>> Thanks,
>>> Pierre-Arnaud
>>>
>>>
>>> On 1 févr. 2012, at 13:22, Christoph Czurda wrote:
>>>
>>>>
>>>>
>>>> On 02/01/2012 01:13 PM, Pierre-Arnaud Marcelot wrote:
>>>>> Christoph,
>>>>>
>>>>> I guess the 'cn=testAttribute' entry is an instance of the 'openengsb-namedObject'
Object Class, right?
>>>> Yes, that's correct.
>>>>>
>>>>> Regards,
>>>>> Pierre-Arnaud
>>>>>
>>>>>
>>>>> On 1 févr. 2012, at 12:26, Christoph Czurda wrote:
>>>>>
>>>>>> Hi Pierre-Arnaud,
>>>>>>
>>>>>> I attached the ldif file. Btw, I used the LdapNetworkConnection as
>>>>>> proposed in another thread. While it enabled my custom schema, it
still
>>>>>> gives the same result for this particular unit test.
>>>>>>
>>>>>> If you have the time, feel free to comment on my schema. It is my
first
>>>>>> schema and I appreciate any feedback.
>>>>>>
>>>>>> Kind regards,
>>>>>> Christoph
>>>>>>
>>>>>> On 02/01/2012 11:34 AM, Pierre-Arnaud Marcelot wrote:
>>>>>>> Thanks Christoph,
>>>>>>>
>>>>>>> I replicated the whole hierarchy of the DN you gave with standard
schema element and I have not been able to reproduce the issue.
>>>>>>>
>>>>>>> As you mentioned in another mail, you're using a custom schema
for your own set of Attribute Types and Object Classes.
>>>>>>> Would you be allowed to share it with us (even in a private email,
not on the ML), so we can replicate the issue and found out more about this strange issue?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Pierre-Arnaud
>>>>>>>
>>>>>>>
>>>>>>> On 1 févr. 2012, at 10:40, Christoph Czurda wrote:
>>>>>>>
>>>>>>>> On 02/01/2012 10:34 AM, Pierre-Arnaud Marcelot wrote:
>>>>>>>>> Hi Christoph,
>>>>>>>>>
>>>>>>>>> Could we have a look at the full DN you're using?
>>>>>>>> Sure, here it is:
>>>>>>>> cn=testAttribute,ou=attributes,cn=testUser,ou=users,ou=userdata,dc=openengsb,dc=org
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Pierre-Arnaud
>>>>>>>>>
>>>>>>>>> On 1 févr. 2012, at 06:16, Christoph Czurda wrote:
>>>>>>>>>
>>>>>>>>>> Hello!
>>>>>>>>>>
>>>>>>>>>> I came accross a strange issue in a unit test. (server
ApacheDS 2.0)
>>>>>>>>>>
>>>>>>>>>> Testing connection.exists(Dn dn) returns false.
>>>>>>>>>> When I test the String overload with the same dn
I get true.
>>>>>>>>>>
>>>>>>>>>> The code can probably explain better than words:
>>>>>>>>>>
>>>>>>>>>> Dn dn;
>>>>>>>>>> //dn is initialized with an existing Dn.
>>>>>>>>>>
>>>>>>>>>> //this test passes:
>>>>>>>>>> assertThat(connection.exists(dn.getName()), is(true));
>>>>>>>>>>
>>>>>>>>>> //this fails. AssertionError: expected true, got
false
>>>>>>>>>> assertThat(connection.exists(dn), is(true));
>>>>>>>>>>
>>>>>>>>>> How can that be? exists(Dn) works fine in other tests.
>>>>>>>>>>
>>>>>>>>>> Maybe I should mention that I get lots of these messages:
>>>>>>>>>>
>>>>>>>>>> 2012-02-01 05:56:00,730 [NioProcessor-2] WARN
>>>>>>>>>> org.apache.directory.shared.asn1.ber.Asn1Decoder
-
>>>>>>>>>> ERR_00043_REMAINING_BYTES_FOR_DECODED_PDU The PDU
has been fully decoded
>>>>>>>>>> but there are still bytes in the buffer.
>>>>>>>>>>
>>>>>>>>>> But they occur with almost every message sent to
the server. Btw, can I
>>>>>>>>>> get rid of them somehow?
>>>>>>>>>>
>>>>>>>>>> Kind regards,
>>>>>>>>>> Christoph
>>>>>>>>>
>>>>>>>
>>>>>> <openengsbSchema.ldif>
>>>>>
>>>
>> <openengsb-branch.ldif><openengsb-branch-with-operational-attributes.ldif>
> 
> 

Mime
View raw message