activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boevink <peter.boev...@ovsoftware.com>
Subject Re: Howto setup JNDI Federation
Date Tue, 15 Jun 2010 13:30:14 GMT

It doesn't have to be populated automatically, it ok to have a little jndi
app.

But how do I bind a ActiveMQ context to an object within my LDAP server?
I have a DirContext for my LDAP Server called "ldapctx".
Now i would like to bind an activeMQ context like this:

Properties envJms = new Properties();
envJms.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
envJms.put(Context.PROVIDER_URL, "tcp://development:61616");

DirContext jmsCtx = new InitialDirContext(envJms);

ldapctx.bind("cn=activeMQ", jmsCtx);


But that fails with the following exception:


javax.naming.NotContextException: Not an instance of DirContext; remaining
name 'cn=activeMQ'
	at
javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(InitialDirContext.java:92)
	at
javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:123)
	at
javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:118)
	at com.sun.jndi.ldap.Obj.determineBindAttrs(Obj.java:551)
	at com.sun.jndi.ldap.LdapCtx.c_bind(LdapCtx.java:385)
	at com.sun.jndi.ldap.LdapCtx.c_bind(LdapCtx.java:354)
	at
com.sun.jndi.toolkit.ctx.ComponentContext.p_bind(ComponentContext.java:596)
	at
com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(PartialCompositeContext.java:183)
	at
com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(PartialCompositeContext.java:173)




Gary Tully wrote:
> 
> There is no easy way to automatically populate a third party jndi provider
> with ActriveMQ objects, you would need to code up a little jndi app that
> can
> bind the objects that you need. It would be a neat extension to
> activemq-admin though if you want to contribute.
> 
> see a previous discussion for some ideas:
> http://old.nabble.com/Generating-.bindings-file-for-RefFSContextFactory-tt28512685.html#a28523033
> 

-- 
View this message in context: http://old.nabble.com/Howto-setup-JNDI-Federation-tp28888636p28891335.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message