You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Ole Ersoy (JIRA)" <ji...@apache.org> on 2007/05/16 05:06:17 UTC

[jira] Created: (DIRSERVER-932) Syntax Entry Attempt Gets "Unexpected exception.];"

Syntax Entry Attempt Gets "Unexpected exception.];"
---------------------------------------------------

                 Key: DIRSERVER-932
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-932
             Project: Directory ApacheDS
          Issue Type: Bug
          Components: ldap
    Affects Versions: 1.5.1
         Environment: Fedora Core 6 x86_64
            Reporter: Ole Ersoy
            Priority: Blocker


I've created a "Schema Syntaxes Container":
ou=syntaxes, cn=das, ou=schema

As well as a "Schema SyntaxCheckers Container":
ou=syntaxCheckers, cn=das, ou=schema

I am able to add a syntax checker via JNDI,
and I can add a Syntax entry using LS, but
when I try to add a Syntax entry with JNDI
I get this exception:

javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'

Initially I thought maybe it was due to me not having
a corresponding syntaxChecker entry, so I created
one, but the exception is still thrown.

Here is the JNDI code I'm using in the test:

        DirContext syntaxesContext =
            InitialContextCreator.
            createSchemaSyntaxesContext( dasSchemaContext);

        Attributes attributes = new BasicAttributes();
        Attribute attribute = new BasicAttribute(
            "objectClass",
            "metaSyntax");
        attribute.add("metaTop");
        attribute.add("top");

        attributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );

        syntaxesContext.createSubcontext(
            "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
            attributes);

The full trace that JUnit gives me looks
like this:

javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3049)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
    at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:774)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236)
    at org.apache.tuscany.das.ldap.configuration.v100.ConnectionManagerTest.testBigTime(ConnectionManagerTest.java:342)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 

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


Re: [jira] Commented: (DIRSERVER-932) Syntax Entry Attempt Gets "Unexpected exception.];"

Posted by Ole Ersoy <ol...@gmail.com>.
Emmanuel,

Good news.

I coded a self contained test and ran it.  It passes.  I'm pasting below.

I'll try running the other test now too, and see if I still
get the exception from that one.  I'll go ahead an close this
until I see whether there is anything else fishy going on.

Cheers,
- Ole

Test:
====================================================

package org.apache.tuscany.das.ldap.create.test;

import java.util.Hashtable;

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.directory.InitialDirContext;

import junit.framework.TestCase;

public class CreateSyntaxEntrySelfContainedTest extends TestCase
{
     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 NamingException
     {
         directoryContext    = connect();
         xsdContext          = createXSDSchemaContext();
         syntaxContext       = createSyntaxContext();
     }

     public void tearDown() throws NamingException
     {
         syntaxContext.destroySubcontext( xsdSyntaxStringRDN );
         syntaxContext.close();
         xsdContext.destroySubcontext( XSD_SYNTAX_RDN );
         xsdContext.close();
         directoryContext.destroySubcontext( XSD_CONTEXT_RDN );
         directoryContext.close();
     }

     public DirContext connect() throws NamingException
     {
                 Hashtable<String,String> env = new Hashtable<String, 
String>();

                 env.put(
                     DirContext.INITIAL_CONTEXT_FACTORY,
                     "com.sun.jndi.ldap.LdapCtxFactory" );
                 env.put(
                     DirContext.PROVIDER_URL,
                     "ldap://localhost:10389/ou=schema");
                 env.put(
                     DirContext.SECURITY_AUTHENTICATION,
                     "simple");
                 env.put(
                     DirContext.SECURITY_PRINCIPAL,
                     "uid=admin,ou=system" );
                 env.put(
                     DirContext.SECURITY_CREDENTIALS,
                    "secret" );
                 return new InitialDirContext(env);
     }

     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 testCreateSyntaxSchemaEntry() 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 );
     }
}

SNIP

Re: [jira] Commented: (DIRSERVER-932) Syntax Entry Attempt Gets "Unexpected exception.];"

Posted by Ole Ersoy <ol...@gmail.com>.
Strange.

I just ran the original test that was giving me the exception,
and it's green too.

I'm starting to wonder if maybe it had something to do with the way
I was running ADS.  The only thing I can think of is that
it was running as "ole" and for some reason it did
not have permission to create the "syntax" entry, but
had permissions to create other entries.  So there would have to
be something different with respect to how syntax entries are created,
vs syntaxChecker for instance...because I could create a syntaxChecker,
and then when I tried to create the syntax I got the unexpected exception...

Anyways - Hopefully this means clears the road to finishing the DAS
initial release.

Cheers,
- Ole



Emmanuel Lecharny (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/DIRSERVER-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496224 ] 
> 
> Emmanuel Lecharny commented on DIRSERVER-932:
> ---------------------------------------------
> 
> Ole, can you post a full running sample, so that we can test it ?
> 
> Thans !
> 
>> Syntax Entry Attempt Gets "Unexpected exception.];"
>> ---------------------------------------------------
>>
>>                 Key: DIRSERVER-932
>>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-932
>>             Project: Directory ApacheDS
>>          Issue Type: Bug
>>          Components: ldap
>>    Affects Versions: 1.5.1
>>         Environment: Fedora Core 6 x86_64
>>            Reporter: Ole Ersoy
>>            Priority: Blocker
>>
>> I've created a "Schema Syntaxes Container":
>> ou=syntaxes, cn=das, ou=schema
>> As well as a "Schema SyntaxCheckers Container":
>> ou=syntaxCheckers, cn=das, ou=schema
>> I am able to add a syntax checker via JNDI,
>> and I can add a Syntax entry using LS, but
>> when I try to add a Syntax entry with JNDI
>> I get this exception:
>> javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
>> Initially I thought maybe it was due to me not having
>> a corresponding syntaxChecker entry, so I created
>> one, but the exception is still thrown.
>> Here is the JNDI code I'm using in the test:
>>         DirContext syntaxesContext =
>>             InitialContextCreator.
>>             createSchemaSyntaxesContext( dasSchemaContext);
>>         Attributes attributes = new BasicAttributes();
>>         Attribute attribute = new BasicAttribute(
>>             "objectClass",
>>             "metaSyntax");
>>         attribute.add("metaTop");
>>         attribute.add("top");
>>         attributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
>>         syntaxesContext.createSubcontext(
>>             "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
>>             attributes);
>> The full trace that JUnit gives me looks
>> like this:
>> javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
>>     at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3049)
>>     at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
>>     at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
>>     at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:774)
>>     at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)
>>     at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248)
>>     at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236)
>>     at org.apache.tuscany.das.ldap.configuration.v100.ConnectionManagerTest.testBigTime(ConnectionManagerTest.java:342)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>     at junit.framework.TestCase.runTest(TestCase.java:154)
>>     at junit.framework.TestCase.runBare(TestCase.java:127)
>>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>>     at junit.framework.TestResult.run(TestResult.java:109)
>>     at junit.framework.TestCase.run(TestCase.java:118)
>>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>     at junit.framework.TestSuite.run(TestSuite.java:203)
>>     at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 
> 

[jira] Commented: (DIRSERVER-932) Syntax Entry Attempt Gets "Unexpected exception.];"

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496224 ] 

Emmanuel Lecharny commented on DIRSERVER-932:
---------------------------------------------

Ole, can you post a full running sample, so that we can test it ?

Thans !

> Syntax Entry Attempt Gets "Unexpected exception.];"
> ---------------------------------------------------
>
>                 Key: DIRSERVER-932
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-932
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: ldap
>    Affects Versions: 1.5.1
>         Environment: Fedora Core 6 x86_64
>            Reporter: Ole Ersoy
>            Priority: Blocker
>
> I've created a "Schema Syntaxes Container":
> ou=syntaxes, cn=das, ou=schema
> As well as a "Schema SyntaxCheckers Container":
> ou=syntaxCheckers, cn=das, ou=schema
> I am able to add a syntax checker via JNDI,
> and I can add a Syntax entry using LS, but
> when I try to add a Syntax entry with JNDI
> I get this exception:
> javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
> Initially I thought maybe it was due to me not having
> a corresponding syntaxChecker entry, so I created
> one, but the exception is still thrown.
> Here is the JNDI code I'm using in the test:
>         DirContext syntaxesContext =
>             InitialContextCreator.
>             createSchemaSyntaxesContext( dasSchemaContext);
>         Attributes attributes = new BasicAttributes();
>         Attribute attribute = new BasicAttribute(
>             "objectClass",
>             "metaSyntax");
>         attribute.add("metaTop");
>         attribute.add("top");
>         attributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
>         syntaxesContext.createSubcontext(
>             "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
>             attributes);
> The full trace that JUnit gives me looks
> like this:
> javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
>     at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3049)
>     at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
>     at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
>     at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:774)
>     at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)
>     at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248)
>     at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236)
>     at org.apache.tuscany.das.ldap.configuration.v100.ConnectionManagerTest.testBigTime(ConnectionManagerTest.java:342)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 

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


[jira] Closed: (DIRSERVER-932) Syntax Entry Attempt Gets "Unexpected exception.];"

Posted by "Ole Ersoy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ole Ersoy closed DIRSERVER-932.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.1

This test runs OK:


package org.apache.tuscany.das.ldap.create.test;

import java.util.Hashtable;

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.directory.InitialDirContext;

import junit.framework.TestCase;

public class CreateSyntaxEntrySelfContainedTest extends TestCase
{
    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 NamingException
    {
        directoryContext    = connect();
        xsdContext          = createXSDSchemaContext();
        syntaxContext       = createSyntaxContext();
    }
    
    public void tearDown() throws NamingException
    {
        syntaxContext.destroySubcontext( xsdSyntaxStringRDN );
        syntaxContext.close();
        xsdContext.destroySubcontext( XSD_SYNTAX_RDN );
        xsdContext.close();
        directoryContext.destroySubcontext( XSD_CONTEXT_RDN );
        directoryContext.close();
    }
    
    public DirContext connect() throws NamingException
    {
                Hashtable<String,String> env = new Hashtable<String, String>();
                
                env.put(
                    DirContext.INITIAL_CONTEXT_FACTORY, 
                    "com.sun.jndi.ldap.LdapCtxFactory" );
                env.put( 
                    DirContext.PROVIDER_URL, 
                    "ldap://localhost:10389/ou=schema");
                env.put( 
                    DirContext.SECURITY_AUTHENTICATION, 
                    "simple");
                env.put( 
                    DirContext.SECURITY_PRINCIPAL, 
                    "uid=admin,ou=system" );
                env.put( 
                    DirContext.SECURITY_CREDENTIALS, 
                   "secret" );
                return new InitialDirContext(env);
    }   
    
    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 testCreateSyntaxSchemaEntry() 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 );
    }
}


> Syntax Entry Attempt Gets "Unexpected exception.];"
> ---------------------------------------------------
>
>                 Key: DIRSERVER-932
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-932
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: ldap
>    Affects Versions: 1.5.1
>         Environment: Fedora Core 6 x86_64
>            Reporter: Ole Ersoy
>            Priority: Blocker
>             Fix For: 1.5.1
>
>
> I've created a "Schema Syntaxes Container":
> ou=syntaxes, cn=das, ou=schema
> As well as a "Schema SyntaxCheckers Container":
> ou=syntaxCheckers, cn=das, ou=schema
> I am able to add a syntax checker via JNDI,
> and I can add a Syntax entry using LS, but
> when I try to add a Syntax entry with JNDI
> I get this exception:
> javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
> Initially I thought maybe it was due to me not having
> a corresponding syntaxChecker entry, so I created
> one, but the exception is still thrown.
> Here is the JNDI code I'm using in the test:
>         DirContext syntaxesContext =
>             InitialContextCreator.
>             createSchemaSyntaxesContext( dasSchemaContext);
>         Attributes attributes = new BasicAttributes();
>         Attribute attribute = new BasicAttribute(
>             "objectClass",
>             "metaSyntax");
>         attribute.add("metaTop");
>         attribute.add("top");
>         attributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
>         syntaxesContext.createSubcontext(
>             "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
>             attributes);
> The full trace that JUnit gives me looks
> like this:
> javax.naming.NamingException: [LDAP: error code 80 - failed to add entry m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5,ou=syntaxes,cn=das,ou=schema: Unexpected exception.]; remaining name 'm-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5'
>     at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3049)
>     at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
>     at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
>     at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:774)
>     at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)
>     at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248)
>     at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236)
>     at org.apache.tuscany.das.ldap.configuration.v100.ConnectionManagerTest.testBigTime(ConnectionManagerTest.java:342)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 

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