Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JNDI Binding question / error.

1 view
Skip to first unread message

Gonzo

unread,
Sep 4, 2001, 10:29:03 AM9/4/01
to
I am trying to bind a java object, via jndi, into an LDAP server and
am getting an error.

We have already bound jms.topics using IBM's JMSAdmin tool (a java
tool), and they are in with names like "bucks" and "dela". Now, we
want to put objects in from another tool instead of using the IBM
tool.

I am able to get the objects in, but I am forced to use "cn=myObject"
instead of "myObject". For programic reasons, the later is what I
need to do.

Here is the code:

...
// create the ctx
InitialDirContext ctx = new InitialDirContext(env);

// create the topic object with topic name of myTopic
Topic q = new com.ibm.mq.jms.MQTopic("myTopic");

// bind the object to the LDAP with the name == the topic name
ctx.bind(new CompositeName("myTopic"),q);

This results in
javax.naming.directory.SchemaViolationException: [LDAP: error code 65
- Object Class Violation]; remaining name 'myTopic'
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:903)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:657)
at com.sun.jndi.ldap.LdapCtx.c_bind(LdapCtx.java:1428)
at com.sun.jndi.ldap.LdapCtx.c_bind(LdapCtx.java:459)
at com.sun.jndi.toolkit.ComponentContext.p_bind(ComponentContext.java:594)
at com.sun.jndi.toolkit.PartialCompositeContext.bind(PartialCompositeContext.java:185)
at javax.naming.InitialContext.bind(InitialContext.java:366)
at JNDITool.main(JNDITool.java:74)

But, if I use

ctx.bind(new CompositeName("cn=myTopic"),q);

it works fine, but appears as "cn=myTopic" in the naming directory.
In order to be backward compatible with another application, I need to
have the name be merely "myTopic".


Anybody know what IBM's JMSAdmin tool is doing differenctly to achieve
this?


TIA,

Gonzo

0 new messages