Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 69950 invoked from network); 8 Mar 2007 20:21:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Mar 2007 20:21:21 -0000 Received: (qmail 6354 invoked by uid 500); 8 Mar 2007 20:21:29 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 6337 invoked by uid 500); 8 Mar 2007 20:21:29 -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 6328 invoked by uid 99); 8 Mar 2007 20:21:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2007 12:21:29 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of james.strachan@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2007 12:21:18 -0800 Received: by ug-out-1314.google.com with SMTP id m3so1135235ugc for ; Thu, 08 Mar 2007 12:20:55 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WoqFOJMrC39WR8lhNjs6d834Fny7s3XMX/n8tvAkO/PuIqLXbY02uebv/ceCZy1H7KpwLWOhup906Vin0GXqzfBGcbe7EbKigTMxO+yQlLv/XX2ZIBEtXQDt7tkVKamiLdrZrJYKfIqObagfUqlAV4ayUnnLz0mmh6X79mA4SzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=f0QPdqH038h8qG5GWYGHJj6ElpdFXpf4h1zCqxASMkvDMLGaguKtOI59cwcorb+OTyi7+gQtA+3r+W+KC2XmixqM1GkJ21MDnhDFkqcQrBS8JkdxpwDMW7cMJtzR8PypFlIcKXBM57WE9YDDjlbeWtLNXlOq5QmqGE+QDDwH+u0= Received: by 10.78.204.20 with SMTP id b20mr110885hug.1173385254735; Thu, 08 Mar 2007 12:20:54 -0800 (PST) Received: by 10.78.155.11 with HTTP; Thu, 8 Mar 2007 12:20:54 -0800 (PST) Message-ID: Date: Thu, 8 Mar 2007 20:20:54 +0000 From: "James Strachan" To: users@activemq.apache.org Subject: Re: [Spam: 5.0] NullPointerException when Getting TopicConnectionFactory from JNDI In-Reply-To: <9381352.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9360907.post@talk.nabble.com> <9381352.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Great thanks for letting us know On 3/8/07, kukusz wrote: > > Exactly what I did, worked great. Apparently you cannot use datasources from > remote VMs. I have not been able to find a satisfactory explanation for > this, however. For anyone facing this problem in the future, using > http://activemq.apache.org/jndi-support.html > http://activemq.apache.org/jndi-support.html is exactly what you need. > > > > James.Strachan wrote: > > > > Is your standalone app still using JBoss JNDI? If not it sounds like > > you need to setup a JNDI context. > > > > http://activemq.apache.org/jndi-support.html > > > > On 3/7/07, kukusz wrote: > >> > >> I've looked almost everywhere for the solution to this particular problem > >> and > >> have had no luck, perhaps someone has seen this. > >> > >> > >> I have integrated ActiveMQ with JBoss and it works great when JNDI grabs > >> the > >> Topic and TopicConnectionFactory from jboss. The test code looks like: > >> > >> > >> > >> > >> System.out.println(context.lookup("jms/TopicConnectionFactory")); > >> > >> System.out.println((Topic) context.lookup("jms/topic")); > >> > >> > >> > >> > >> Both of those lines of code give me something in the log when running > >> code > >> deployed in a WAR in JBoss. However, a standalone app return a null > >> connection factory. Furthermore, additional logging using > >> context.listBindings shows the connection factory listed with the correct > >> class type. > >> > >> > >> Here is the connection factory as defined in the datasource: > >> > >> > >> > >> <no-tx-connection-factory> > >> <jndi-name>jms/TopicConnectionFactory</jndi-name> > >> <use-java-context>false</use-java-context> > >> <rar-name>activemq-ra.rar</rar-name> > >> > >> <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> > >> <ServerUrl>vm://localhost</ServerUrl> > >> <min-pool-size>1</min-pool-size> > >> <max-pool-size>200</max-pool-size> > >> > >> <blocking-timeout-millis>30000</blocking-timeout-millis> > >> <idle-timeout-minutes>3</idle-timeout-minutes> > >> </no-tx-connection-factory> > >> > >> > >> > >> I essentially followed this > >> http://devzone.logicblaze.com/site/integrating-apache-activemq-with-jboss.html > >> jboss integration documentation with some minor modifications, such as > >> setting <use-java-context>false</use-java-context>. I also > >> tried changing "vm://" to "tcp://" in case that would help. Any ideas > >> would > >> be greatly appreciated. > >> -- > >> View this message in context: > >> http://www.nabble.com/NullPointerException-when-Getting-TopicConnectionFactory-from-JNDI-tf3364562s2354.html#a9360907 > >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >> > > > > > > -- > > > > James > > ------- > > http://radio.weblogs.com/0112098/ > > > > > > -- > View this message in context: http://www.nabble.com/NullPointerException-when-Getting-TopicConnectionFactory-from-JNDI-tf3364562s2354.html#a9381352 > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- James ------- http://radio.weblogs.com/0112098/