From users-return-32174-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Wed Oct 17 07:29:10 2012 Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF81DD153 for ; Wed, 17 Oct 2012 07:29:10 +0000 (UTC) Received: (qmail 24734 invoked by uid 500); 17 Oct 2012 07:29:10 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 24387 invoked by uid 500); 17 Oct 2012 07:29:08 -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 24356 invoked by uid 99); 17 Oct 2012 07:29:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2012 07:29:06 +0000 X-ASF-Spam-Status: No, hits=3.0 required=5.0 tests=FORGED_YAHOO_RCVD,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2012 07:28:54 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TONs9-0004iT-TY for users@activemq.apache.org; Wed, 17 Oct 2012 00:16:58 -0700 Date: Wed, 17 Oct 2012 00:16:57 -0700 (PDT) From: cristisor To: users@activemq.apache.org Message-ID: <1350458217903-4657877.post@n4.nabble.com> In-Reply-To: <1350408818606-4657861.post@n4.nabble.com> References: <1350396269080-4657851.post@n4.nabble.com> <1350408818606-4657861.post@n4.nabble.com> Subject: Re: Basic ActiveMQ example help MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Good morning, In tomee.xml I have the following resources configured: BrokerXmlConfig = (tcp://localhost:61616)?useJmx=true; ResourceAdapter = JMSAdapter destination = Queue1 destination = Topic1 I also deployed the activemq web-console and I access it at: http://localhost:8080/activemq-web-console-5.7.0/index.jsp but the Queues, Topics and Connections tabs don't show any resource. I suppose that I can only get RemoteInitialContextFactory and not ActiveMQInitialContextFactory because the resources are deployed in Tomee+ and I can only have access to the server context, right? Here is my code, please tell me if it's the correct approach: final Hashtable ctxProps = new Hashtable(4); ctxProps.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory"); ctxProps.put("java.naming.provider.url", "http://localhost:8080/tomee/ejb"); ctxProps.put("java.naming.security.principal", "tomee"); ctxProps.put("java.naming.security.credentials", "tomee"); InitialContext ctx = new InitialContext(ctxProps); ConnectionFactory cf = (ConnectionFactory) context.lookup("JMSConnectionFactory"); This approach doesn't work: final Hashtable ctxProps = new Hashtable(2); ctxProps.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); ctxProps.put("java.naming.provider.url", "http://localhost:61616"); InitialContext ctx = new InitialContext(ctxProps); ConnectionFactory cf = (ConnectionFactory) context.lookup("JMSConnectionFactory"); Is it because the resources are located in tomee.xml? ActiveMQInitialContextFactory doesn't exist at all in the tomee container, I can't use it even from an application deployed on tomee? One last thing, why do I need the parameter below in order to get the ActiveMQConnectionFactory? -DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616 Thank you very much for your help. -- View this message in context: http://activemq.2283324.n4.nabble.com/Basic-ActiveMQ-example-help-tp4657851p4657877.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.