PDA

View Full Version : Gettings Attributes from an objectclass



cristian_sfercoci
May 21st, 2007, 03:44 AM
Hi,I would Iike to know how I could get attributes from an objectclass from Oracle Internet Directory.
For example : cn=Users has some objectclass attributes{top,abstract} and I want to find how I can extract specific attributes for these two objecclass.
I tryed to use DirContext personSchema = (DirContext) contextUser.getReadWriteContext().getSchemaClassDe finition(""); where contextSource is defined as LdapContextSource dirctx=new LdapContextSource();
dirctx.setBase("cn=Users,dc=virtual7,dc=local");
dirctx.setUserName("cn=xxxxxx");
dirctx.setPassword("xxxxxx");
dirctx.setUrl("ldap://myadress.local:389");
dirctx.afterPropertiesSet();
contextUser = dirctx;;
but it doesn't work

cristian_sfercoci
May 22nd, 2007, 07:43 AM
I also receive:
javax.naming.NamingException: problem generating object using object factory [Root exception is org.springframework.ldap.BadLdapGrammarException: Failed to parse DN; nested exception is org.springframework.ldap.support.TokenMgrError: Lexical error at line 1, column 5. Encountered: ":" (58), after : ""]; remaining name ''
at com.sun.jndi.ldap.LdapSearchEnumeration.createItem (LdapSearchEnumeration.java:111)
at com.sun.jndi.ldap.LdapNamingEnumeration.nextAux(Ld apNamingEnumeration.java:255)
at com.sun.jndi.ldap.LdapNamingEnumeration.nextImpl(L dapNamingEnumeration.java:235)
at com.sun.jndi.ldap.LdapNamingEnumeration.next(LdapN amingEnumeration.java:183)
at com.sun.jndi.ldap.LdapCtx.buildSchemaTree(LdapCtx. java:1594)
at com.sun.jndi.ldap.LdapCtx.getSchemaTree(LdapCtx.ja va:1560)
at com.sun.jndi.ldap.LdapCtx.c_getSchema(LdapCtx.java :1501)
at com.sun.jndi.ldap.LdapCtx.c_getSchemaClassDefiniti on(LdapCtx.java:1522)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_get SchemaClassDefinition(ComponentDirContext.java:436 )
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContex t.getSchemaClassDefinition(PartialCompositeDirCont ext.java:415)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContex t.getSchemaClassDefinition(PartialCompositeDirCont ext.java:403)
at javax.naming.directory.InitialDirContext.getSchema ClassDefinition(InitialDirContext.java:194)
at com.virtual7.oidportlet.dao.oracle.TestLdap.testGe tObjecRoot(TestLdap.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154 )
at junit.framework.TestCase.runBare(TestCase.java:127 )
at junit.framework.TestResult$1.protect(TestResult.ja va: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 org.eclipse.jdt.internal.junit.runner.junit3.JUnit 3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)

davsclaus
May 22nd, 2007, 07:44 AM
What version of Spring LDAP are you using?

cristian_sfercoci
May 22nd, 2007, 08:52 AM
1.1.2
and
jdk 1.4.2

cristian_sfercoci
May 22nd, 2007, 09:40 AM
I tried also with 1.2 but exception persist

rasky
May 22nd, 2007, 10:21 AM
It seems that this is pretty much the same issue as this thread (http://forum.springframework.org/showthread.php?t=37720), am I correct?

It might be an issue to look into; feel free to post a jira issue.
Cheers,