directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aswartha N Rupa (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DIRSERVER-1673) org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.OutOfMemoryError: ;
Date Tue, 25 Oct 2011 05:30:33 GMT

     [ https://issues.apache.org/jira/browse/DIRSERVER-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aswartha N Rupa updated DIRSERVER-1673:
---------------------------------------

    Attachment: List2.java

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


                
> org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.OutOfMemoryError: ;
> ------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1673
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1673
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.6
>         Environment: jdk1.6, windows 7, Apache Directory Studio Version: 1.5.3.v20100330,
apache ldap API, apache-ldap-api-1.0.0-M8-bin
>            Reporter: Aswartha N Rupa
>            Assignee: Pierre-Arnaud Marcelot
>            Priority: Blocker
>              Labels: API, LDAP, LDAPPRotocolDecoder, ProtocolDecoderException, mina,
outofmemory
>             Fix For: 2.0.0-M3
>
>         Attachments: Apache-LDAP_API.zip, List2.java, example.ldif
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message