You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by boevink <pe...@ovsoftware.com> on 2010/06/15 10:37:05 UTC

Howto setup JNDI Federation

We are using an LDAP server for registering remote objects that can be
retrieved through JNDI.
This is our Global Initial Context.

Is there a way to retrieve ActiveMQ objects through this global Initial
Context instead of having the need to configure a seperate Initial Context
for ActiveMQ's internal JNDI Server?

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


Re: Howto setup JNDI Federation

Posted by boevink <pe...@ovsoftware.com>.
Ok, this helps a bit...

But is does not bind the root context of activeMQ and I have to bind every
object seperately.
In our default installation of activeMQ there exist already the following
objects:

QueueConnectionFactory
dynamicTopics
TopicConnectionFactory
ConnectionFactory
dynamicQueues

If I'm able to bind the root context of activeMQ to an object, makes life
easier :-)


Joe Fernandez wrote:
> 
> I've attached a PDF that illustrates how to bind and lookup AMQ objects to
> and from an LDAP server using JNDI. 
> 
>  http://old.nabble.com/file/p28891251/AmqLdapJndi.pdf AmqLdapJndi.pdf 
> 
> Joe
> ActiveMQ Ref Guide - http://bit.ly/AMQRefGuide
> 

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


Re: Howto setup JNDI Federation

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
I've attached a PDF that illustrates how to bind and lookup AMQ objects to
and from an LDAP server using JNDI. 

http://old.nabble.com/file/p28891251/AmqLdapJndi.pdf AmqLdapJndi.pdf 

Joe
ActiveMQ Ref Guide - http://bit.ly/AMQRefGuide




boevink wrote:
> 
> We are using an LDAP server for registering remote objects that can be
> retrieved through JNDI.
> This is our Global Initial Context.
> 
> Is there a way to retrieve ActiveMQ objects through this global Initial
> Context instead of having the need to configure a seperate Initial Context
> for ActiveMQ's internal JNDI Server?
> 
> 

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


Re: Howto setup JNDI Federation

Posted by boevink <pe...@ovsoftware.com>.
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.


Re: Howto setup JNDI Federation

Posted by Gary Tully <ga...@gmail.com>.
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

On 15 June 2010 09:37, boevink <pe...@ovsoftware.com> wrote:

>
> We are using an LDAP server for registering remote objects that can be
> retrieved through JNDI.
> This is our Global Initial Context.
>
> Is there a way to retrieve ActiveMQ objects through this global Initial
> Context instead of having the need to configure a seperate Initial Context
> for ActiveMQ's internal JNDI Server?
>
> --
> View this message in context:
> http://old.nabble.com/Howto-setup-JNDI-Federation-tp28888636p28888636.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com