activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thinkbox <>
Subject Re: ActiveMQ-CPP client using JNDI
Date Fri, 20 Nov 2009 08:15:33 GMT

Hi Tim,

I am still not able to grasp the concept of ActiveMQ and how its
destinations are made available with JNDI.

I am following the tutorial at this link
Integrating Apache ActiveMQ with JBoss . I was able to successfully test the
results of this tutorial.

However when I created a simple Java JMS client and tried to obtain a
destination based on the configuration mentioned in the above tutorial
through JNDI lookup, I get an Exception stating:

java.lang.ClassCastException - javax.naming.Reference cannot be cast to

Below is the code snippet,

Context initialContext = new InitialContext
ConnectionFactory conn =
//this next line throws the Exception
Destination destination =

If it's not too much to ask, are there any readings that describe the
configuration of ActiveMQ through JNDI?

- Pat

Timothy Bish wrote:
> On Tue, 2009-11-17 at 17:56 -0800, thinkbox wrote:
>> Hi All,
>> I have embedded an ActiveMQ broker in JBoss and bind the JMS destination
>> through JBoss JNDI. My Java JMS clients is sending to this destination
>> through JNDI. On the other end, my C++ JMS clients would need to connect
>> to
>> the said destination. My question is, how can I search for that JNDI
>> context
>> in ActiveMQ-CPP? Does ActiveMQ-CPP support JNDI?
>> I have tried to use the JNDI name as a parameter to the createXXX()
>> method
>> of my C++ client but it doesn't seem to receive any messages. However, my
>> Java clients (using JNDI lookup) was able to receive messages.
>> - Pat
> ActiveMQ-CPP cannot perform JNDI lookups, no.  You'd have to use the
> physical name of the destination and connect a topic or a queue to it
> accordingly.  
> Regards
> Tim.
> -- 
> Tim Bish

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message