activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sonicfab <>
Subject JNDI lookup problem from standalone VM
Date Sat, 26 Mar 2011 00:11:32 GMT
Hi all.
I'm running an ActiveMQ client in a standalone JVM (i.e. no web or J2EE
container), and am trying to perform a JNDI lookup of the connection
factory, using the standard JMS way of setting the env in a Properties
object (rather than using a file). Here's the code snippet :
Context context;
Properties env = new Properties();
env.setProperty(Context.PROVIDER_URL, "tcp://my_server_name:61616");
javax.naming.Context context = new InitialContext(env);
ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory)

And I get this error :
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial

I don't understand because I have set the Context.INITIAL_CONTEXT_FACTORY

Help please ?

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

View raw message