[
https://issues.apache.org/jira/browse/CONFIGURATION-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694403#action_12694403
]
Ralph Goers commented on CONFIGURATION-379:
-------------------------------------------
OK. Your problem is as follows.
1. CIMSystem is a singleton.
2. CIMSystem.execute is being called from multiple threads.
3. execute calls CIMConfiguration.configure.
4. CIMConfiguration has a PropertiesConfiguration as a class member variable.
5. The configure method sets this class member variable to a new
PropertiesConfiguration.
6. setURL is called to set the url.
Here is the problem -
7. A second thread enters CIMConfiguration.configure and does "config = new
PropertiesConfiguration()". This new configuration doesn't have its url set.
8. The first thread calls load on the new PropertiesConfiguration created in
step 7.
> 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.