Hi,
Am a newbie to activemq and trying to use jndi.properties with the examples
from activemq downloads.
I read http://activemq.apache.org/jndi-support.html and did the following
code changes
I appreciate if someone could reply back to my question and let me know
where i went wrong.
Am getting nullpointerexception.
below is the code snippet.
In TopicPublisher.java
javax.naming.Context ctx = new javax.naming.InitialContext();
javax.jms.ConnectionFactory factory =
(javax.jms.ConnectionFactory)ctx.lookup("ConnectionFactory");
javax.jms.Topic mytopic = (javax.jms.Topic)ctx.lookup("MyTopic");
Jndi.properties(Is in apache-activemq-4.1.1\conf folder)
java.naming.factory.initial =org.activemq.jndi.ActiveMQInitialContextFactory
#java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory
# use the following property to configure the default connector
java.naming.provider.url = tcp://hostname:61616
# use the following property to specify the JNDI name the connection factory
# should appear as.
connectionFactoryNames =ConnectionFactory
# register some topics in JNDI using the form
# topic.[jndiName] = [physicalName]
topic.MyTopic =MyTopic
Thanks
--
View this message in context:
http://www.nabble.com/nullpoinetexception-while-using-jndi--with-built-in-examples-tp14319922s2354p14319922.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.