Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 35862 invoked from network); 26 Apr 2007 09:51:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 09:51:33 -0000 Received: (qmail 20636 invoked by uid 500); 26 Apr 2007 09:51:39 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 20384 invoked by uid 500); 26 Apr 2007 09:51:38 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 20375 invoked by uid 99); 26 Apr 2007 09:51:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 02:51:38 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 02:51:31 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1Hh0d4-0002vV-KX for users@activemq.apache.org; Thu, 26 Apr 2007 02:51:10 -0700 Message-ID: <10197412.post@talk.nabble.com> Date: Thu, 26 Apr 2007 02:51:10 -0700 (PDT) From: tonyc To: users@activemq.apache.org Subject: Re: javax.naming.NameNotFoundException - JNDI In-Reply-To: <10175148.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: anthony.cremona@dpworld.com References: <10175148.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Yes, the suggestion about the case sensititvity of the factory name was correct. thanks tony tonyc wrote: > > Hi, > > I just downloaded activeMQ 4.1.1 to learn something about message > queues. > I started the message broker and used example code to run a JMS client. > > I tried to follow the instructions in JNDI support to use JNDI names but > had no luck, I keep getting a javax.naming.NameNotFoundException error. > have included the error message below. > > I created a jndi.properties file based on the example shown. have also > included the contents below. > I tried placing the jndi.properties file in my own jar file "jndi.jar" > which i refer to in the classpath. > I also placed the jndi.properties in the apache-activemq-4.1.1.jar . I am > not sure whether the jndi.properties file has > to be placed in a particular location in the jar. Tried a few things but > still I keep getting the error message. > > > i have also included a java code snippet. > > would appreciate any help. > > > thanks > > tony > > JMS CLIENT CODE SNIPPET: > ================= > ConnectionFactory connectionFactory = null; > Destination dest = null; > > try { > connectionFactory = > (ConnectionFactory) > jndiContext.lookup("ConnectionFactory"); > } catch (Exception e) { > System.out.println("JNDI API lookup for connection failed: " + > e.toString()); > e.printStackTrace(); > System.exit(1); > } > > try{ > dest = (Destination) jndiContext.lookup(destName); > } catch (Exception e) { > System.out.println("JNDI API for dest lookup failed: " + > e.toString()); > e.printStackTrace(); > System.exit(1); > } > > > > JNDI PROPERTIES: > =========== > > java.naming.factory.initial = > org.apache.activemq.jndi.ActiveMQInitialContextFactory > > # use the following property to configure the default connector > java.naming.provider.url = tcp://localhost:61616 > > # use the following property to specify the JNDI name the connection > factory > # should appear as. > #jms.ConnectionFactory = ConnectionFactory > connectionFactoryNames = connectionFactory, queueConnectionFactory, > topicConnectionFactry > > > # register some queues in JNDI using the form > # queue.[jndiName] = [physicalName] > queue.jms.Queue = PhysicalQueue > > > # register some topics in JNDI using the form > # topic.[jndiName] = [physicalName] > jms.Topic = PhysicalTopic > > > > > ERROR MESSAGE: > ========== > > JNDI API lookup for connection failed: javax.naming.NameNotFoundException: > Conn > ctionFactory > javax.naming.NameNotFoundException: ConnectionFactory > at > org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java > 215) > at javax.naming.InitialContext.lookup(Unknown Source) > at > SimpleProducer.main(SimpleProducer.java:94)javax.naming.NameNotFoundException > > > > -- View this message in context: http://www.nabble.com/javax.naming.NameNotFoundException---JNDI-tf3643462s2354.html#a10197412 Sent from the ActiveMQ - User mailing list archive at Nabble.com.