OpenLDAP & java

S

steve

I tried to use the openldap in java.

But, I could not get the example work.
http://www.cris.com/~adhawan/tutorial/

I got this error:
javax.naming.directory.SchemaViolationException: [LDAP: error code 65 -
object class 'javaContainer' requires attribute
'cn']; remaining name 'o=jndiTest'


What's wrong? Is it the openldap (latest version) can not work with java?

I tried using ldapadd, no problem.
 
S

Sudsy

steve wrote:
I got this error:
javax.naming.directory.SchemaViolationException: [LDAP: error code 65 -
object class 'javaContainer' requires attribute
'cn']; remaining name 'o=jndiTest'

It's all right there! "requires attribute 'cn'", which is common name.
Your lookup obviously didn't include this attribute. Check your
ldap.conf file.
What's wrong? Is it the openldap (latest version) can not work with java?

What's wrong is that you seem to have difficulty interpreting the
diagnostic messages.
 
I

iksrazal

steve said:
I tried to use the openldap in java.

But, I could not get the example work.
http://www.cris.com/~adhawan/tutorial/

I got this error:
javax.naming.directory.SchemaViolationException: [LDAP: error code 65 -
object class 'javaContainer' requires attribute
'cn']; remaining name 'o=jndiTest'


What's wrong? Is it the openldap (latest version) can not work with java?

I tried using ldapadd, no problem.

1) Did you add the root context via MakeRoot.java? Using the ldap
browser, did you see the entry?
2) is 'o=jnditest' the suffix in slapd.conf ?
3) The cn is Manager in this tutorial. Does that cn and o in your code
match your rootdn in slapd.conf ?

I used the same tutorial successfully a while back, and I've been
doing a lot with java and openldap. It works well.

HTH

Outsource to an American programmer living in brazil!
http://www.braziloutsource.com/
iksrazal
 
Joined
Jun 28, 2009
Messages
1
Reaction score
0
Hi,

If you're like me and try to get your feet wet with LDAP and JNDI, you probablly stumbled over the LAVA OpenLdap tutorial, and as you tried to follow it, you ran into

javax.naming.directory.SchemaViolationException: [LDAP: error code 65...

error, and then you googled it and stumbled over this forum here. Here's what I have to say about what's been discussed here:

1. The Java Openldap tutorial is garbage, it goes through alot of stuff without explaining it properlly, and the code is just wrong, as it is proned to errors if you try it just as it is listed. I'm not even gonna give the link to this tutorial, since it's no good. A better tutorial, which is a lot more comprehensive and actually works is the one from SUN, found here:

java.sun.com/docs/books/tutorial/jndi/ops/index.[eich_tee_em_ell]

I tried it with under Fedora 10, using OpenLdap, Php Ldap Admin and JDK 1.6 and it works fine. They give a ldif file which you can use to populate your ldap db, and you can import that via PLA. (about PLA: don't forget to install openldap-client package, aside from PHP 5, as PLA needs it to run). Good luck and have fun

2. The people who answered in this thred to the first guy's question are kind of jerks. Obviously they are pros at the whole thing, but they are rude for no reason, esecially since the guy's question was perfectlly legitimate, as that problem actually happends and it's not his fault.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top