activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Corsi <>
Subject Re: JNDI lookup problem from standalone VM
Date Mon, 28 Mar 2011 17:01:12 GMT
You need to include a jndi service provider.  

With ActiveMQ you can follow these instructions: 

From: sonicfab <>
Sent: Fri, March 25, 2011 8:11:32 PM
Subject: JNDI lookup problem from standalone VM

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message