Directory Client API
  1. Directory Client API
  2. DIRAPI-55

LDAP API can't be used with log4j default configuration when no 'log4j.properties' is available

    Details

      Description

      A simple program that performs a search on the sample ldif shipped with apache DS>

      public class List {

      public static void main(String[] args) throws Exception{
      LdapConnection connection = new LdapNetworkConnection( "localhost", 10389 , false);
      System.out.println("got connection");

      connection.bind( "uid=admin,ou=system", "secret" );
      SearchRequest searchRequest = new SearchRequestImpl();
      searchRequest.setBase(new Dn("ou=Users,dc=example,dc=com"));
      searchRequest.setFilter("(&(sn=)(mail=mplanck))");
      searchRequest.setScope(SearchScope.ONELEVEL);
      String [] attributes =

      { "cn", "mail", "telephonenumber" }

      ;
      searchRequest.addAttributes(attributes);

      SearchCursor cursor = connection.search(searchRequest);

      if (cursor.next())

      { Response response = cursor.get(); System.out.println( ((SearchResultEntry)response).getEntry() ); System.out.println( "Trying to close the cursor" ); cursor.close(); }

      //SearchResultDone done = cursor.getSearchResultDone();
      System.out.println( "Trying to close the connection" );
      connection.close();
      System.out.println( "Trying to close the cursor done" );
      }
      }

      Its prints the first record and waits for more than 10-15 minutes (after the connection.close() is invoke on main thread) giving out an outofmemory error on protocol decoder. I see two threads [NioProcessor] and [NioSocketConnector] in Running state even after main thread executed its last statement.

      With output:
      log4j:WARN No appenders could be found for logger (org.apache.directory.ldap.client.api.LdapConnectionConfig).
      log4j:WARN Please initialize the log4j system properly.
      log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
      got connection
      Entry
      dn: uid=mplanck,ou=Users,dc=example,dc=com
      mail: mplanck@example.com
      cn: Max Planck
      telephonenumber: +1 904 982 6882

      Trying to close the cursor
      Trying to close the connection
      Trying to close the cursor done
      org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.OutOfMemoryError: Java heap space (Hexdump: 30 4E 02 01 02 73 49 04 47 6C 64 61 70 3A 2F 2F 61 64 2E 65 78 61 6D 70 6C 65 2E 63 6F 6D 2F 75 69 64 3D 70 64 69 72 61 63 2C 25 32 30 6F 75 3D 55 73 65 72 73 2C 25 32 30 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 3F 3F 62 61 73 65 30 54 02 01 02 73 4F 04 4D 6C 64 61 70 3A 2F 2F 6F 70 65 6E 6C 64 61 70 2E 65 78 61 6D 70 6C 65 2E 63 6F 6D 2F 75 69 64 3D 65 66 65 72 6D 69 2C 25 32 30 6F 75 3D 55 73 65 72 73 2C 25 32 30 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 3F 3F 62 61 73 65 30 56 02 01 02 73 51 04 4F 6C 64 61 70 3A 2F 2F 61 70 61 63 68 65 64 73 2E 65 78 61 6D 70 6C 65 2E 63 6F 6D 2F 75 69 64 3D 72 66 65 79 6E 6D 61 6E 2C 25 32 30 6F 75 3D 55 73 65 72 73 2C 25 32 30 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 3F 3F 62 61 73 65 30 0C 02 01 02 65 07 0A 01 00 04 00 04 00)
      at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:251)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
      at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:715)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:68)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1141)
      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.OutOfMemoryError: Java heap space
      at java.nio.CharBuffer.wrap(CharBuffer.java:350)
      at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:238)
      at java.lang.StringCoding.encode(StringCoding.java:272)
      at java.lang.String.getBytes(String.java:946)
      at org.apache.directory.shared.util.Strings.getBytesUtf8(Strings.java:1426)
      at org.apache.directory.shared.ldap.model.name.Dn.apply(Dn.java:1222)
      at org.apache.directory.shared.ldap.model.name.Dn.<init>(Dn.java:283)
      at org.apache.directory.shared.ldap.model.name.Dn.<init>(Dn.java:207)
      at org.apache.directory.shared.ldap.model.url.LdapUrl.parseDN(LdapUrl.java:676)
      at org.apache.directory.shared.ldap.model.url.LdapUrl.parse(LdapUrl.java:198)
      at org.apache.directory.shared.ldap.model.url.LdapUrl.<init>(LdapUrl.java:308)
      at org.apache.directory.shared.ldap.codec.actions.searchResultReference.StoreReference.action(StoreReference.java:97)
      at org.apache.directory.shared.ldap.codec.actions.searchResultReference.StoreReference.action(StoreReference.java:47)
      at org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar.executeAction(AbstractGrammar.java:138)
      at org.apache.directory.shared.asn1.ber.Asn1Decoder.treatTLVDoneState(Asn1Decoder.java:599)
      at org.apache.directory.shared.asn1.ber.Asn1Decoder.decode(Asn1Decoder.java:735)
      at org.apache.directory.shared.ldap.codec.api.LdapDecoder.decode(LdapDecoder.java:157)
      at org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolDecoder.decode(LdapProtocolDecoder.java:79)
      at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:241)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
      at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:715)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:68)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1141)
      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

      1. Apache-LDAP_API.zip
        5.01 MB
        Aswartha N Rupa
      2. example.ldif
        74 kB
        Aswartha N Rupa
      3. List2.java
        2 kB
        Aswartha N Rupa
      4. log4j.properties
        1 kB
        Pierre-Arnaud Marcelot

        Activity

        Hide
        Emmanuel Lecharny added a comment -

        We need more informations.

        What is the LDAP server ?
        Do you have a full working sample (with the data you used) ?

        Show
        Emmanuel Lecharny added a comment - We need more informations. What is the LDAP server ? Do you have a full working sample (with the data you used) ?
        Hide
        Aswartha N Rupa added a comment -

        Apache-LDAP_API.zip : Eclipse project having the sample along with the libraries

        example.ldif : sample ldif file imported to Apache DS

        Show
        Aswartha N Rupa added a comment - Apache-LDAP_API.zip : Eclipse project having the sample along with the libraries example.ldif : sample ldif file imported to Apache DS
        Hide
        Aswartha N Rupa added a comment -

        Hi,

        Please see the attachments for the working sample.

        LDAP Server being used - Apache DS 1.5.7 (used with Apache Directory Studio 1.5.3)

        Thanks,
        Aswarth

        Show
        Aswartha N Rupa added a comment - Hi, Please see the attachments for the working sample. LDAP Server being used - Apache DS 1.5.7 (used with Apache Directory Studio 1.5.3) Thanks, Aswarth
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Hi Aswartha,

        Thanks to your files. I was able to reproduce the bug in a similar setup (same code - using ApacheDS inside Studio).

        I then switched to the latest milestone version of ApacheDS 2.0 and the problem doesn't appear on that version.

        So, it was definitely a bug in ApacheDS 1.5.x (1.5.6 was bundled with Studio 1.5.3) and that bug has been fixed in ApacheDS 2.0

        You should move to the latest version of ApacheDS 2.0.

        Many thanks for reporting the bug.

        Regards,
        Pierre-Arnaud

        Show
        Pierre-Arnaud Marcelot added a comment - Hi Aswartha, Thanks to your files. I was able to reproduce the bug in a similar setup (same code - using ApacheDS inside Studio). I then switched to the latest milestone version of ApacheDS 2.0 and the problem doesn't appear on that version. So, it was definitely a bug in ApacheDS 1.5.x (1.5.6 was bundled with Studio 1.5.3) and that bug has been fixed in ApacheDS 2.0 You should move to the latest version of ApacheDS 2.0. Many thanks for reporting the bug. Regards, Pierre-Arnaud
        Hide
        Pierre-Arnaud Marcelot added a comment -

        I move the issue to the DIRSERVER Jira project since it's a lot more related to the server that the API.

        DIRAPI-54 > DIRSERVER-1673

        Show
        Pierre-Arnaud Marcelot added a comment - I move the issue to the DIRSERVER Jira project since it's a lot more related to the server that the API. DIRAPI-54 > DIRSERVER-1673
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Fixed by ApacheDS 2.0.0-M3

        Show
        Pierre-Arnaud Marcelot added a comment - Fixed by ApacheDS 2.0.0-M3
        Hide
        Aswartha N Rupa added a comment -

        Thanks Pierre-Aurnaud. With ApacheDS 2.0.0-M3 I see that the issue is resolved.But I would like to bring another issue to your notice.

        In List.java, the search filter (searchRequest.setFilter("(&(sn=)(mail=mplanck))") was supposed to return a single entry. As you mentioned, I couldnt recreate the issue.

        But, using List2.java (attached), when I changed the SearchFilter [searchRequest.setFilter("(&(sn=*))");] to return more than one entry and iterate the cursor using next() and get(),

        while (cursor.next())

        { Response response = cursor.get(); System.out.println( ((SearchResultEntry)response).getEntry() ); }

        I could still see issue reproduce after a long delay with [NioProcessor-2] thread still running. The program never terminated.

        Output for List2.java
        =====================
        got connection
        log4j:WARN No appenders could be found for logger (org.apache.directory.ldap.client.api.LdapConnectionConfig).
        log4j:WARN Please initialize the log4j system properly.
        log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
        Entry
        dn: uid=mplanck,ou=Users,dc=example,dc=com
        mail: mplanck@example.com
        cn: Max Planck
        telephonenumber: +1 904 982 6882

        Exception in thread "main" org.apache.directory.shared.ldap.model.exception.LdapException: TimeOut occured
        at org.apache.directory.ldap.client.api.SearchCursorImpl.next(SearchCursorImpl.java:125)
        at List2.main(List2.java:28)
        org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.OutOfMemoryError: Java heap space (Hexdump: 30 81 92 02 01 02 64 81 8C 04 28 75 69 64 3D 61 65 69 6E 73 74 65 69 6E 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 60 30 17 04 02 63 6E 31 11 04 0F 41 6C 62 65 72 74 20 45 69 6E 73 74 65 69 6E 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1F 04 04 6D 61 69 6C 31 17 04 15 61 65 69 6E 73 74 65 69 6E 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 84 02 01 02 64 7F 04 24 75 69 64 3D 6E 62 6F 68 72 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 57 30 12 04 02 63 6E 31 0C 04 0A 4E 65 69 6C 73 20 42 6F 68 72 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1B 04 04 6D 61 69 6C 31 13 04 11 6E 62 6F 68 72 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 82 02 01 02 64 7D 04 24 75 69 64 3D 6D 62 6F 72 6E 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 55 30 10 04 02 63 6E 31 0A 04 08 4D 61 78 20 42 6F 72 6E 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1B 04 04 6D 61 69 6C 31 13 04 11 6D 62 6F 72 6E 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 8B 02 01 02 64 81 85 04 25 75 69 64 3D 77 70 61 75 6C 69 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 5C 30 16 04 02 63 6E 31 10 04 0E 57 6F 6C 66 67 61 6E 67 20 50 61 75 6C 69 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1C 04 04 6D 61 69 6C 31 14 04 12 77 70 61 75 6C 69 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 88 02 01 02 64 81 82 04 25 75 69 64 3D 6D 63 75 72 69 65 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 59 30 13 04 02 63 6E 31 0D 04 0B 4D 61 72 69 65 20 43 75 72 69 65 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1C 04 04 6D 61 69 6C 31 14 04 12 6D 63 75 72 69 65 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 0C 02 01 02 65 07 0A 01 00 04 00 04 00)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:251)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
        at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:715)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:68)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1141)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
        Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:3209)
        at java.lang.String.<init>(String.java:215)
        at java.lang.StringBuffer.toString(StringBuffer.java:585)
        at org.apache.directory.shared.util.Strings.dumpBytes(Strings.java:178)
        at org.apache.directory.shared.ldap.codec.api.LdapDecoder.decode(LdapDecoder.java:151)
        at org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolDecoder.decode(LdapProtocolDecoder.java:79)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:241)
        ... 15 more

        Show
        Aswartha N Rupa added a comment - Thanks Pierre-Aurnaud. With ApacheDS 2.0.0-M3 I see that the issue is resolved.But I would like to bring another issue to your notice. In List.java, the search filter (searchRequest.setFilter("(&(sn= )(mail=mplanck ))") was supposed to return a single entry. As you mentioned, I couldnt recreate the issue. But, using List2.java (attached), when I changed the SearchFilter [searchRequest.setFilter("(&(sn=*))");] to return more than one entry and iterate the cursor using next() and get(), while (cursor.next()) { Response response = cursor.get(); System.out.println( ((SearchResultEntry)response).getEntry() ); } I could still see issue reproduce after a long delay with [NioProcessor-2] thread still running. The program never terminated. Output for List2.java ===================== got connection log4j:WARN No appenders could be found for logger (org.apache.directory.ldap.client.api.LdapConnectionConfig). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Entry dn: uid=mplanck,ou=Users,dc=example,dc=com mail: mplanck@example.com cn: Max Planck telephonenumber: +1 904 982 6882 Exception in thread "main" org.apache.directory.shared.ldap.model.exception.LdapException: TimeOut occured at org.apache.directory.ldap.client.api.SearchCursorImpl.next(SearchCursorImpl.java:125) at List2.main(List2.java:28) org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.OutOfMemoryError: Java heap space (Hexdump: 30 81 92 02 01 02 64 81 8C 04 28 75 69 64 3D 61 65 69 6E 73 74 65 69 6E 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 60 30 17 04 02 63 6E 31 11 04 0F 41 6C 62 65 72 74 20 45 69 6E 73 74 65 69 6E 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1F 04 04 6D 61 69 6C 31 17 04 15 61 65 69 6E 73 74 65 69 6E 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 84 02 01 02 64 7F 04 24 75 69 64 3D 6E 62 6F 68 72 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 57 30 12 04 02 63 6E 31 0C 04 0A 4E 65 69 6C 73 20 42 6F 68 72 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1B 04 04 6D 61 69 6C 31 13 04 11 6E 62 6F 68 72 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 82 02 01 02 64 7D 04 24 75 69 64 3D 6D 62 6F 72 6E 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 55 30 10 04 02 63 6E 31 0A 04 08 4D 61 78 20 42 6F 72 6E 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1B 04 04 6D 61 69 6C 31 13 04 11 6D 62 6F 72 6E 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 8B 02 01 02 64 81 85 04 25 75 69 64 3D 77 70 61 75 6C 69 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 5C 30 16 04 02 63 6E 31 10 04 0E 57 6F 6C 66 67 61 6E 67 20 50 61 75 6C 69 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1C 04 04 6D 61 69 6C 31 14 04 12 77 70 61 75 6C 69 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 81 88 02 01 02 64 81 82 04 25 75 69 64 3D 6D 63 75 72 69 65 2C 6F 75 3D 55 73 65 72 73 2C 64 63 3D 65 78 61 6D 70 6C 65 2C 64 63 3D 63 6F 6D 30 59 30 13 04 02 63 6E 31 0D 04 0B 4D 61 72 69 65 20 43 75 72 69 65 30 24 04 0F 74 65 6C 65 70 68 6F 6E 65 6E 75 6D 62 65 72 31 11 04 0F 2B 31 20 39 30 34 20 39 38 32 20 36 38 38 32 30 1C 04 04 6D 61 69 6C 31 14 04 12 6D 63 75 72 69 65 40 65 78 61 6D 70 6C 65 2E 63 6F 6D 30 0C 02 01 02 65 07 0A 01 00 04 00 04 00) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:251) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:715) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668) at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:68) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1141) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Arrays.java:3209) at java.lang.String.<init>(String.java:215) at java.lang.StringBuffer.toString(StringBuffer.java:585) at org.apache.directory.shared.util.Strings.dumpBytes(Strings.java:178) at org.apache.directory.shared.ldap.codec.api.LdapDecoder.decode(LdapDecoder.java:151) at org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolDecoder.decode(LdapProtocolDecoder.java:79) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:241) ... 15 more
        Hide
        Aswartha N Rupa added a comment -

        It still reproducible if cursor returns more than one entry. Please see my earlier comment giving the details.

        Show
        Aswartha N Rupa added a comment - It still reproducible if cursor returns more than one entry. Please see my earlier comment giving the details.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Indeed.

        We will investigate this.

        Thanks for reopening the issue and providing the code to reproduce it.

        Show
        Pierre-Arnaud Marcelot added a comment - Indeed. We will investigate this. Thanks for reopening the issue and providing the code to reproduce it.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        I moved back the issue to the LDAP API project.

        We have debugged this a little with Emmanuel and it seems to be related with logs.

        When run inside our LDAP API project, the List2.java class behaves well and does not crash.

        Adding a log4j.properties file in the dedicated project seem to fix the issue (I will attach one to the issue, for you to test if you like).

        Very weird... We need to dig more to find the exact cause of the issue.

        Show
        Pierre-Arnaud Marcelot added a comment - I moved back the issue to the LDAP API project. We have debugged this a little with Emmanuel and it seems to be related with logs. When run inside our LDAP API project, the List2.java class behaves well and does not crash. Adding a log4j.properties file in the dedicated project seem to fix the issue (I will attach one to the issue, for you to test if you like). Very weird... We need to dig more to find the exact cause of the issue.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Here's the log4j.properties file.

        Show
        Pierre-Arnaud Marcelot added a comment - Here's the log4j.properties file.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        There seem to be an infinite loop when logging with a DEBUG level.

        Probably a wrong loop which is not updating its loop cursor in one of our DEBUG statements.

        Show
        Pierre-Arnaud Marcelot added a comment - There seem to be an infinite loop when logging with a DEBUG level. Probably a wrong loop which is not updating its loop cursor in one of our DEBUG statements.
        Hide
        Emmanuel Lecharny added a comment -

        Ok, this was a bug in the LdapDecoder class : the ByteBuffer was reset so decoded again.

        It has been fixed in trunk, we will release a new version soon.

        A workaround would be to add a log4j.properties file with debug trace set to OFF, disabling the DEBUG portion of the code generating the issue.

        Thanks for the report.

        Show
        Emmanuel Lecharny added a comment - Ok, this was a bug in the LdapDecoder class : the ByteBuffer was reset so decoded again. It has been fixed in trunk, we will release a new version soon. A workaround would be to add a log4j.properties file with debug trace set to OFF, disabling the DEBUG portion of the code generating the issue. Thanks for the report.
        Hide
        Aswartha N Rupa added a comment -

        Thanks Pierre-Arnaud and Emmanuel.

        With log4j.properties, I see the issue is not reproducible.

        Show
        Aswartha N Rupa added a comment - Thanks Pierre-Arnaud and Emmanuel. With log4j.properties, I see the issue is not reproducible.

          People

          • Assignee:
            Pierre-Arnaud Marcelot
            Reporter:
            Aswartha N Rupa
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development