Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 673CA8C61 for ; Tue, 30 Aug 2011 21:55:56 +0000 (UTC) Received: (qmail 67298 invoked by uid 500); 30 Aug 2011 21:55:56 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 67138 invoked by uid 500); 30 Aug 2011 21:55:55 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 67131 invoked by uid 99); 30 Aug 2011 21:55:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 21:55:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 21:55:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3A03823888E7 for ; Tue, 30 Aug 2011 21:55:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1163422 - /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java Date: Tue, 30 Aug 2011 21:55:31 -0000 To: commits@qpid.apache.org From: rajith@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110830215531.3A03823888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rajith Date: Tue Aug 30 21:55:30 2011 New Revision: 1163422 URL: http://svn.apache.org/viewvc?rev=1163422&view=rev Log: QPID-3395 Applied Pavel's patch with minor modifications. Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java?rev=1163422&r1=1163421&r2=1163422&view=diff ============================================================================== --- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java (original) +++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java Tue Aug 30 21:55:30 2011 @@ -36,6 +36,7 @@ import javax.jms.Queue; import javax.jms.Topic; import javax.naming.Context; import javax.naming.NamingException; +import javax.naming.ConfigurationException; import javax.naming.spi.InitialContextFactory; import org.apache.qpid.client.AMQConnectionFactory; @@ -139,7 +140,7 @@ public class PropertiesFileInitialContex return new ReadOnlyContext(environment, data); } - protected void createConnectionFactories(Map data, Hashtable environment) + protected void createConnectionFactories(Map data, Hashtable environment) throws ConfigurationException { for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { @@ -157,7 +158,7 @@ public class PropertiesFileInitialContex } } - protected void createDestinations(Map data, Hashtable environment) + protected void createDestinations(Map data, Hashtable environment) throws ConfigurationException { for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { @@ -225,7 +226,7 @@ public class PropertiesFileInitialContex /** * Factory method to create new Connection Factory instances */ - protected ConnectionFactory createFactory(String url) + protected ConnectionFactory createFactory(String url) throws ConfigurationException { try { @@ -233,16 +234,18 @@ public class PropertiesFileInitialContex } catch (URLSyntaxException urlse) { - _logger.warn("Unable to createFactories:" + urlse); - } + _logger.warn("Unable to create factory:" + urlse); - return null; + ConfigurationException ex = new ConfigurationException("Failed to parse entry: " + urlse + " due to : " + urlse.getMessage()); + ex.initCause(urlse); + throw ex; + } } /** * Factory method to create new Destination instances from an AMQP BindingURL */ - protected Destination createDestination(String str) + protected Destination createDestination(String str) throws ConfigurationException { try { @@ -252,7 +255,9 @@ public class PropertiesFileInitialContex { _logger.warn("Unable to create destination:" + e, e); - return null; + ConfigurationException ex = new ConfigurationException("Failed to parse entry: " + str + " due to : " + e.getMessage()); + ex.initCause(e); + throw ex; } } --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org