Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 4808 invoked from network); 1 Apr 2009 03:07:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 03:07:19 -0000 Received: (qmail 5445 invoked by uid 500); 1 Apr 2009 03:07:18 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 5290 invoked by uid 500); 1 Apr 2009 03:07:18 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 5279 invoked by uid 99); 1 Apr 2009 03:07:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 03:07:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 03:07:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E01A9234C003 for ; Tue, 31 Mar 2009 20:06:50 -0700 (PDT) Message-ID: <1889381433.1238555210903.JavaMail.jira@brutus> Date: Tue, 31 Mar 2009 20:06:50 -0700 (PDT) From: "ranbir singh (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (CONFIGURATION-379) org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source null In-Reply-To: <559823784.1238551850475.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CONFIGURATION-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694363#action_12694363 ] ranbir singh commented on CONFIGURATION-379: -------------------------------------------- Thanks a lot for your prompt action. As required, please find below the code for configure method: I have removed the exta code to avoid any confusion. We call configure() method, which in turns call configure(String path) . public class CIMConfiguration { .... private PropertiesConfiguration config = null; .... public CIMConfiguration configure() { String configFile = System.getProperty(CIM_CONFIG_FILE); if (!StringUtils.isBlank(configFile)) configure(configFile); else configure("cim.properties"); return this; } public CIMConfiguration configure(String path) { URL url = ConfigurationUtils.locate(path); config = new PropertiesConfiguration(); config.setURL(url); try { log.info("Loading configuration ["+url+"]..."); config.load(); } catch (ConfigurationException e) { e.printStackTrace(); log.warn(path + " open error",e); throw new CIMException(e); } return this; } FYI: The line "log.info("Loading configuration ["+url+"]...");" prints " Loading configuration [file:/D:/applications/CIM/CIM-Config/cim.properties]..." correctly and the file exists at that location. > org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source null > ------------------------------------------------------------------------------------------------ > > Key: CONFIGURATION-379 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-379 > Project: Commons Configuration > Issue Type: Bug > Affects Versions: 1.4 > Environment: Windows XP, Tomcat 5.5 server, Quarts 1.6.0 > Reporter: ranbir singh > Priority: Critical > > In one of my projects, we are using commons-configuration to read properties file. There are multiple threads that are trying to read property in this property file and many times fails giving following exception: > org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source null > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:213) > at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:193) > at com.mycomp.myapp.CIMConfiguration.configure(CIMConfiguration.java:104) > at com.mycomp.myapp.CIMConfiguration.configure(CIMConfiguration.java:89) > at com.mycomp.myapp.InterfaceJob.execute(InterfaceJob.java:64) > at org.quartz.core.JobRunShell.run(JobRunShell.java:202) > at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529) > To my understanding, this error is reported from > Class: AbstractFileConfiguration.java > Method: load(String fileName) throws ConfigurationException > { > URL url = ConfigurationUtils.locate(basePath, fileName); > if (url == null) > { > throw new ConfigurationException("Cannot locate configuration source " + fileName); } > load(url); > } > I have checked& printed that the filename passed to this method is correct. > Please advice -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.