Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AD32D200C85 for ; Mon, 15 May 2017 18:31:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ABB3C160BA9; Mon, 15 May 2017 16:31:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F06C6160BC2 for ; Mon, 15 May 2017 18:31:08 +0200 (CEST) Received: (qmail 40761 invoked by uid 500); 15 May 2017 16:31:08 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 40683 invoked by uid 99); 15 May 2017 16:31:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2017 16:31:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B414D1A0327 for ; Mon, 15 May 2017 16:31:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id YtOmXB8AwLNs for ; Mon, 15 May 2017 16:31:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 584455FC7E for ; Mon, 15 May 2017 16:31:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D1B4AE0D56 for ; Mon, 15 May 2017 16:31:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4AF0924384 for ; Mon, 15 May 2017 16:31:04 +0000 (UTC) Date: Mon, 15 May 2017 16:31:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARTEMIS-1164) NameNotFoundException when using java.naming.provider.url to set url via jndi MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 15 May 2017 16:31:09 -0000 [ https://issues.apache.org/jira/browse/ARTEMIS-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16010804#comment-16010804 ] ASF GitHub Bot commented on ARTEMIS-1164: ----------------------------------------- GitHub user michaelandrepearce opened a pull request: https://github.com/apache/activemq-artemis/pull/1270 ARTEMIS-1164: NameNotFoundException java.naming.provider.url to set url via jndi Support setting PROVIDER_URL on initial context to create default connection factories. To match documentation https://activemq.apache.org/artemis/docs/2.0.0/using-jms.html, and also behaviour that existed in ActiveMQ 5.x You can merge this pull request into a Git repository by running: $ git pull https://github.com/michaelandrepearce/activemq-artemis ARTEMIS-1164 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/activemq-artemis/pull/1270.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1270 ---- commit 7f1885563979522302f217184c8e5f8014acdf82 Author: Michael Andre Pearce Date: 2017-05-15T16:23:52Z ARTEMIS-1164: NameNotFoundException when using java.naming.provider.url to set url via jndi Support setting PROVIDER_URL on initial context to create default connection factories. ---- > NameNotFoundException when using java.naming.provider.url to set url via jndi > ------------------------------------------------------------------------------ > > Key: ARTEMIS-1164 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1164 > Project: ActiveMQ Artemis > Issue Type: Bug > Reporter: Michael Andre Pearce > > It should be possible to create a connection factory via JNDI simply defining the initial context factory and provider url. > {noformat} > java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory > java.naming.provider.url=tcp://localhost:5445?type=CF > {noformat} > As per samples in docs. > https://activemq.apache.org/artemis/docs/2.0.0/using-jms.html > This does not seems to be the case, see below test to prove this. > {code:java} > @Test > public void providerURLTest() throws NamingException { > String url = "(tcp://somehost:62616,tcp://somehost:62616)?ha=true"; > > Properties props = new Properties(); > props.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getName()); > props.setProperty(javax.naming.Context.PROVIDER_URL, url); > InitialContext context = new InitialContext(props); > ConnectionFactory connectionFactory = (ConnectionFactory)context.lookup("ConnectionFactory"); > } > {code} > It seems and mandatory param (duplicating the required and standard java.naming.provider.url), > {noformat} > props.setProperty("connectionFactory.ConnectionFactory",url); > {noformat} > {code:java} > @Test > public void connectionFactoryProperty() throws NamingException { > String url = "(tcp://somehost:62616,tcp://somehost:62616)?ha=true"; > Properties props = new Properties(); > props.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getName()); > props.setProperty(javax.naming.Context.PROVIDER_URL, url); > props.setProperty("connectionFactory.ConnectionFactory",url); > InitialContext context = new InitialContext(props); > ConnectionFactory connectionFactory = (ConnectionFactory)context.lookup("ConnectionFactory"); > } > {code} > Either: > A) the documentation samples need to be changed > OR > B) The ActiveMQInitialContextFactory should default register connection factory created using java.naming.provider.url as ConnectionFactory. > I would propose the latter, as this seems to be the way in Active MQ 5 and some other technologies. -- This message was sent by Atlassian JIRA (v6.3.15#6346)