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 
http://activemq.apache.org/integrating-apache-activemq-with-jboss.html
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
javax.jms.Destination

Below is the code snippet,

...
Context initialContext = new InitialContext
ConnectionFactory conn =
(ConnectionFactory)initialContext.lookup("ConnectionFactory");
//this next line throws the Exception
Destination destination =
(Destination)initialContext.lookup("activemq/queue/outbound");
...

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
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ActiveMQ-CPP-client-using-JNDI-tp26401197p26430032.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to