title: ActiveMQ: Issue with queue lookup
body: <p>I've set up a queue by configuring it in activemq.xml (ActiveMQ version 5.2.0) as described in the <a href="http://activemq.apache.org/configure-startup-destinations.html" rel="noreferrer">documentation</a>.</p>
  
  <pre><code>&lt;destinations&gt;
      &lt;queue physicalName="FOO.BAR" /&gt;
      &lt;queue physicalName="DUMMY" /&gt;
  &lt;/destinations&gt;
  </code></pre>
  
  <p>I'm trying to access it from java (on the same host) with the following code:</p>
  
  <pre><code>Hashtable properties = new Hashtable();
  properties.put(Context.INITIAL_CONTEXT_FACTORY, 
      "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
  properties.put(Context.PROVIDER_URL, "tcp://localhost:61616");
  
  context = new InitialContext(properties);
  
  factory = (ConnectionFactory) context.lookup("ConnectionFactory");
  connection = factory.createConnection();
  session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
  queueName = "DUMMY"; // which can be either FOO.BAR or DUMMY
  dest = (Destination) context.lookup(queueName);
  </code></pre>
  
  <p>I'm receveing the following error, although the queue is visible in jconsole (Tree / org.apache.activemq / Queue):</p>
  
  <pre><code>javax.naming.NameNotFoundException: DUMMY
  </code></pre>
  
  <p>Please tell me what I'm doing wrong. Many, many thanks!</p>