directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kiran Ayyagari (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRSERVER-1908) Connection lost when use persistent search and move entry in ApacheDS
Date Thu, 24 Oct 2013 07:15:02 GMT

    [ https://issues.apache.org/jira/browse/DIRSERVER-1908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13803940#comment-13803940
] 

Kiran Ayyagari commented on DIRSERVER-1908:
-------------------------------------------

Which version of server you are running?, do you have any test code to reproduce this?

I have tested this with the below code and I see it working as expected

    @Test
    public void testPsearchMove() throws Exception
    {
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort()
);
        connection.bind( "uid=admin,ou=system", "secret" );
        
        Entry newOu = new DefaultEntry( "uid=persist, ou=users,ou=system" );
        newOu.add( "objectClass", "inetOrgPerson" );
        newOu.add( "cn", "persist_cn" );
        newOu.add( "sn", "persist_sn" );
        
        connection.add( newOu );
        
        SearchRequest sr = new SearchRequestImpl();
        sr.setBase( new Dn( BASE ) );
        sr.setFilter( "(objectClass=*)" );
        sr.setScope( SearchScope.SUBTREE );
        sr.addControl( new PersistentSearchImpl() );
        
        final SearchCursor cursor = connection.search( sr );
        
        final List<Entry> entryList = new ArrayList<Entry>();
        
        Runnable r = new Runnable()
        {
            
            @Override
            public void run()
            {
                try
                {
                    while( cursor.next() )
                    {
                        entryList.add( cursor.getEntry() );
                    }
                }
                catch( Exception e )
                {
                    throw new RuntimeException( e );
                }
            }
        };
        
        new Thread( r ).start();
        
        connection.move( newOu.getDn(), newOu.getDn().getParent().getParent() );
        Thread.sleep( 1000 );
        assertFalse( entryList.isEmpty() );
        assertEquals( 1, entryList.size() );
        assertEquals( "uid=persist,ou=system", entryList.get( 0 ).getDn().getName() );
        
        connection.close();
    }


> Connection lost when use persistent search and move entry in ApacheDS
> ---------------------------------------------------------------------
>
>                 Key: DIRSERVER-1908
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1908
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M14
>         Environment: Windows 7 Professional 32-bit, Inter Core i3-2310,4GB Memory
>            Reporter: Robert Hou
>
> Step:
> 1.Do persistent search with ApacheDS.
> 2.Move one entry(InetorgPerson) from one ou to another ou in ApacheDS.
> Actual Result(from Apache Console):
> [10:17:10] WARN [org.apache.directory.server.ldap.LdapProtocolHandler] - Unexpected exception
forcing session to close: sending disconnect notice to client.
> org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.NullPointerException
> 	at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:339)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:482)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:47)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:775)
> 	at org.apache.mina.filter.executor.ExecutorFilter.filterWrite(ExecutorFilter.java:614)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:482)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:47)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:775)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:705)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:482)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:475)
> 	at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:494)
> 	at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:439)
> 	at org.apache.directory.server.ldap.handlers.PersistentSearchListener.entryMoved(PersistentSearchListener.java:194)
> 	at org.apache.directory.server.core.event.EventInterceptor$4.run(EventInterceptor.java:171)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
> 	at org.apache.directory.api.ldap.codec.decorators.SearchResultEntryDecorator.computeLength(SearchResultEntryDecorator.java:308)
> 	at org.apache.directory.api.ldap.codec.api.LdapEncoder.computeMessageLength(LdapEncoder.java:247)
> 	at org.apache.directory.api.ldap.codec.api.LdapEncoder.encodeMessage(LdapEncoder.java:159)
> 	at org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolEncoder.encode(LdapProtocolEncoder.java:71)
> 	at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:308)
> 	... 17 more



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message