directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ole Ersoy (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (DIRSERVER-942) Server Feezes When Doing https://issues.apache.org/jira/browse/DIRSERVER-935
Date Sat, 18 Aug 2007 20:51:30 GMT

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

ole edited comment on DIRSERVER-942 at 8/18/07 1:49 PM:
--------------------------------------------------------------

OK - I retested this.  First I commented out the "testDeleteNonExistingSyntaxSchemaEntry"
test.  Everything runs fine.  Then I ran it with the testDeleteNonExistingSyntaxSchemaEntry
test.  The server freezes.  I ran it in debug mode, and here's the output from the console:

[15:26:44] WARN [org.apache.directory.server.core.DefaultDirectoryService] - You didn't change
the admin password of directory service instance 'default'.  Please update the admin password
as soon as possible to prevent a possible security breach.
[15:29:03] ERROR [org.apache.directory.shared.ldap.codec.LdapMessageGrammar] - The DN to delete
: monkeywrench,ou=syntaxes,cn=xsd,ou=system (0x6D 0x6F 0x6E 0x6B 0x65 0x79 0x77 0x72 0x65
0x6E 0x63 0x68 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x6E 0x74 0x61 0x78 0x65 0x73 0x2C 0x63 0x6E
0x3D 0x78 0x73 0x64 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x73 0x74 0x65 0x6D ) is invalid : Bad DN
: monkeywrench,ou=syntaxes,cn=xsd,ou=system
[15:29:03] ERROR [org.apache.directory.shared.ldap.codec.LdapMessageGrammar] - The DN to delete
: monkeywrench,ou=syntaxes,cn=xsd,ou=system (0x6D 0x6F 0x6E 0x6B 0x65 0x79 0x77 0x72 0x65
0x6E 0x63 0x68 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x6E 0x74 0x61 0x78 0x65 0x73 0x2C 0x63 0x6E
0x3D 0x78 0x73 0x64 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x73 0x74 0x65 0x6D ) is invalid : Bad DN
: monkeywrench,ou=syntaxes,cn=xsd,ou=system

After this output the server is frozen.  I verified this by attempting to rerun the tests
and they just turn red.  On the first run, all the tests pass, except for the testDeleteNonExistingSyntaxSchemaEntry
test, which just hangs.



Here's the test code just in case it's helpful (I just copied the JNDIConnectionTemplateTest
from the testing archetype and pasted the code from the attached test):

/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *  
 *    http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License. 
 *  
 */
package org.apache.directory.apacheds.testing.setup;

import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
import javax.naming.directory.DirContext;
import javax.naming.ldap.LdapContext;

/*
 * These tests require a running server.
 */
public class CopyOfJNDIConnectionTemplateTest extends JNDIConnectionTemplate  
{
	private static LdapContext systemContext  = null;
	private static LdapContext schemaContext = null;
    private static final String XSD_CONTEXT_RDN     = "cn=xsd";
    private static final String XSD_SYNTAX_RDN      = "ou=syntaxes";
    private static final String OID    = "1.3.6.1.4.1.18060.0.4.0.0.100000.233.1233";
    
    private DirContext directoryContext = null;
    private DirContext xsdContext       = null;
    private DirContext syntaxContext    = null;
    private String xsdSyntaxStringRDN = "m-oid" + "=" + OID;

    
    public void setUp() throws Exception
    {
        super.setUp();
        directoryContext    = connect();
        xsdContext          = createXSDSchemaContext();
        syntaxContext       = createSyntaxContext();
    }
    
    public void tearDown() throws Exception
    {
        syntaxContext.destroySubcontext( xsdSyntaxStringRDN );
        syntaxContext.close();
        xsdContext.destroySubcontext( XSD_SYNTAX_RDN );
        xsdContext.close();
        directoryContext.destroySubcontext( XSD_CONTEXT_RDN );
        directoryContext.close();
        super.tearDown();
    }
    
    public void testSystemContextConnection() 
    throws NamingException
    {
    	systemContext = connect();
    	assertNotNull( systemContext );
        assertNotNull( connect() );
        assertEquals(
        		systemContext.getNameInNamespace(), "ou=system");
    }
    
    public void testSchemaContextConnection() 
    throws NamingException
    {
    	providerPath    = SCHEMA_PROVIDER_PATH;
    	schemaContext = connect();
    	assertNotNull (schemaContext);
        assertNotNull(connect());
        assertEquals(
        		schemaContext.getNameInNamespace(), 
        		"ou=schema");
    }
    
    public DirContext createXSDSchemaContext() throws NamingException
    {
        Attributes xsdAttributes = new BasicAttributes();

        Attribute topAttribute = new BasicAttribute(
            "objectClass", 
            "top"); 

        Attribute metaSchemaAttribute = new BasicAttribute(
            "objectClass", 
            "metaSchema");
        
        Attribute xsdAttribute = new BasicAttribute(
            "cn", 
            "xsd");
        
        Attribute mDependenciesAttribute = new BasicAttribute(
            "m-dependencies", "system");

        xsdAttributes.put( xsdAttribute );
        xsdAttributes.put( topAttribute );
        xsdAttributes.put( metaSchemaAttribute );
        xsdAttributes.put( mDependenciesAttribute );
        
        return directoryContext.createSubcontext( 
            XSD_CONTEXT_RDN, xsdAttributes );
    }
    
    
    public DirContext createSyntaxContext() throws NamingException
    {
        Attribute syntaxesAttribute = new BasicAttribute(
            "ou", "syntaxes");

        Attribute organizationUnitAttribute = new BasicAttribute(
            "objectClass", "organizationalUnit");
    
        Attribute topAttribute = new BasicAttribute(
            "objectClass", 
            "top"); 

        Attribute metaSchemaAttribute = new BasicAttribute(
            "objectClass", 
            "metaSchema");

        Attributes syntaxAttributes = new BasicAttributes();
        syntaxAttributes.put( syntaxesAttribute );
        syntaxAttributes.put( topAttribute );
        syntaxAttributes.put( metaSchemaAttribute );
        syntaxAttributes.put( organizationUnitAttribute);
        
        return ( DirContext ) xsdContext.createSubcontext( XSD_SYNTAX_RDN, syntaxAttributes
);
    }
    
    
    public void testDeleteNonExistingSyntaxSchemaEntry() throws NamingException
    {
        Attribute objectClassAttribute = new BasicAttribute(
            "objectClass", 
            "top" );
        
        objectClassAttribute.add( "metaTop" );
        objectClassAttribute.add( "metaSyntax" );
        
        Attribute oidAttribute = new BasicAttribute(
            "m-oid", 
            OID);
        
        Attribute descriptionAttribute = new BasicAttribute(
            "m-description", 
            "xsd:String");
        
        Attributes attributes = new BasicAttributes();
        
        attributes.put( objectClassAttribute );
        attributes.put( oidAttribute );
        attributes.put( descriptionAttribute );

        syntaxContext.createSubcontext( xsdSyntaxStringRDN, attributes );
        syntaxContext.lookup(xsdSyntaxStringRDN);
        syntaxContext.destroySubcontext("monkeywrench");
    }
    
    
    
}


      was (Author: ole):
    OK - I retested this.  First I commented out the "testDeleteNonExistingSyntaxSchemaEntry"
test.  Everything runs fine.  Then I ran it with the testDeleteNonExistingSyntaxSchemaEntry
test.  The server freezes.  I ran it in debug mode, and here's the output from the console:

[15:26:44] WARN [org.apache.directory.server.core.DefaultDirectoryService] - You didn't change
the admin password of directory service instance 'default'.  Please update the admin password
as soon as possible to prevent a possible security breach.
[15:29:03] ERROR [org.apache.directory.shared.ldap.codec.LdapMessageGrammar] - The DN to delete
: monkeywrench,ou=syntaxes,cn=xsd,ou=system (0x6D 0x6F 0x6E 0x6B 0x65 0x79 0x77 0x72 0x65
0x6E 0x63 0x68 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x6E 0x74 0x61 0x78 0x65 0x73 0x2C 0x63 0x6E
0x3D 0x78 0x73 0x64 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x73 0x74 0x65 0x6D ) is invalid : Bad DN
: monkeywrench,ou=syntaxes,cn=xsd,ou=system
[15:29:03] ERROR [org.apache.directory.shared.ldap.codec.LdapMessageGrammar] - The DN to delete
: monkeywrench,ou=syntaxes,cn=xsd,ou=system (0x6D 0x6F 0x6E 0x6B 0x65 0x79 0x77 0x72 0x65
0x6E 0x63 0x68 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x6E 0x74 0x61 0x78 0x65 0x73 0x2C 0x63 0x6E
0x3D 0x78 0x73 0x64 0x2C 0x6F 0x75 0x3D 0x73 0x79 0x73 0x74 0x65 0x6D ) is invalid : Bad DN
: monkeywrench,ou=syntaxes,cn=xsd,ou=system

After this output the server

Here's the test code just in case it's helpful (I just copied the JNDIConnectionTemplateTest
from the testing archetype and pasted the code from the attached test):

/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *  
 *    http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License. 
 *  
 */
package org.apache.directory.apacheds.testing.setup;

import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
import javax.naming.directory.DirContext;
import javax.naming.ldap.LdapContext;

/*
 * These tests require a running server.
 */
public class CopyOfJNDIConnectionTemplateTest extends JNDIConnectionTemplate  
{
	private static LdapContext systemContext  = null;
	private static LdapContext schemaContext = null;
    private static final String XSD_CONTEXT_RDN     = "cn=xsd";
    private static final String XSD_SYNTAX_RDN      = "ou=syntaxes";
    private static final String OID    = "1.3.6.1.4.1.18060.0.4.0.0.100000.233.1233";
    
    private DirContext directoryContext = null;
    private DirContext xsdContext       = null;
    private DirContext syntaxContext    = null;
    private String xsdSyntaxStringRDN = "m-oid" + "=" + OID;

    
    public void setUp() throws Exception
    {
        super.setUp();
        directoryContext    = connect();
        xsdContext          = createXSDSchemaContext();
        syntaxContext       = createSyntaxContext();
    }
    
    public void tearDown() throws Exception
    {
        syntaxContext.destroySubcontext( xsdSyntaxStringRDN );
        syntaxContext.close();
        xsdContext.destroySubcontext( XSD_SYNTAX_RDN );
        xsdContext.close();
        directoryContext.destroySubcontext( XSD_CONTEXT_RDN );
        directoryContext.close();
        super.tearDown();
    }
    
    public void testSystemContextConnection() 
    throws NamingException
    {
    	systemContext = connect();
    	assertNotNull( systemContext );
        assertNotNull( connect() );
        assertEquals(
        		systemContext.getNameInNamespace(), "ou=system");
    }
    
    public void testSchemaContextConnection() 
    throws NamingException
    {
    	providerPath    = SCHEMA_PROVIDER_PATH;
    	schemaContext = connect();
    	assertNotNull (schemaContext);
        assertNotNull(connect());
        assertEquals(
        		schemaContext.getNameInNamespace(), 
        		"ou=schema");
    }
    
    public DirContext createXSDSchemaContext() throws NamingException
    {
        Attributes xsdAttributes = new BasicAttributes();

        Attribute topAttribute = new BasicAttribute(
            "objectClass", 
            "top"); 

        Attribute metaSchemaAttribute = new BasicAttribute(
            "objectClass", 
            "metaSchema");
        
        Attribute xsdAttribute = new BasicAttribute(
            "cn", 
            "xsd");
        
        Attribute mDependenciesAttribute = new BasicAttribute(
            "m-dependencies", "system");

        xsdAttributes.put( xsdAttribute );
        xsdAttributes.put( topAttribute );
        xsdAttributes.put( metaSchemaAttribute );
        xsdAttributes.put( mDependenciesAttribute );
        
        return directoryContext.createSubcontext( 
            XSD_CONTEXT_RDN, xsdAttributes );
    }
    
    
    public DirContext createSyntaxContext() throws NamingException
    {
        Attribute syntaxesAttribute = new BasicAttribute(
            "ou", "syntaxes");

        Attribute organizationUnitAttribute = new BasicAttribute(
            "objectClass", "organizationalUnit");
    
        Attribute topAttribute = new BasicAttribute(
            "objectClass", 
            "top"); 

        Attribute metaSchemaAttribute = new BasicAttribute(
            "objectClass", 
            "metaSchema");

        Attributes syntaxAttributes = new BasicAttributes();
        syntaxAttributes.put( syntaxesAttribute );
        syntaxAttributes.put( topAttribute );
        syntaxAttributes.put( metaSchemaAttribute );
        syntaxAttributes.put( organizationUnitAttribute);
        
        return ( DirContext ) xsdContext.createSubcontext( XSD_SYNTAX_RDN, syntaxAttributes
);
    }
    
    
    public void testDeleteNonExistingSyntaxSchemaEntry() throws NamingException
    {
        Attribute objectClassAttribute = new BasicAttribute(
            "objectClass", 
            "top" );
        
        objectClassAttribute.add( "metaTop" );
        objectClassAttribute.add( "metaSyntax" );
        
        Attribute oidAttribute = new BasicAttribute(
            "m-oid", 
            OID);
        
        Attribute descriptionAttribute = new BasicAttribute(
            "m-description", 
            "xsd:String");
        
        Attributes attributes = new BasicAttributes();
        
        attributes.put( objectClassAttribute );
        attributes.put( oidAttribute );
        attributes.put( descriptionAttribute );

        syntaxContext.createSubcontext( xsdSyntaxStringRDN, attributes );
        syntaxContext.lookup(xsdSyntaxStringRDN);
        syntaxContext.destroySubcontext("monkeywrench");
    }
    
    
    
}

  
> Server Feezes When Doing https://issues.apache.org/jira/browse/DIRSERVER-935
> ----------------------------------------------------------------------------
>
>                 Key: DIRSERVER-942
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-942
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: ldap
>    Affects Versions: 1.5.0
>            Reporter: Ole Ersoy
>             Fix For: 1.5.1
>
>         Attachments: CreateSyntaxEntrySelfContainedTest.java
>
>
> This is related to https://issues.apache.org/jira/browse/DIRSERVER-935
> By accident I tried running some code that deletes (935 looks up)
> entries that are not present.
> The server froze and I could not connect with LS
> anymore.
> First I assumed it crashed, so I tried doing
> ./apacheds start
> But I still could not connect
> so I tried doing 
> ./apacheds stop
> ./aapcheds start
> and back to normal.
> I need to code a self contained test for this.
> Cheers,
> - Ole

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message