• Post Reply Bookmark Topic Watch Topic
  • New Topic

org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source null  RSS feed

 
ranbir singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Apache Commons Configuration API (commons-configuration-1.4.jar) to load properties file.
Single properties file is read in multithreaded way simultanously by no. of Jobs ( implementation of org.quartz.Job )


The source code is:



The line prints correct path
2009-03-19 03:20:00,016 INFO [QuartzScheduler_Worker-3] CIMConfiguration - Loading configuration [file:/D:/applications/CIM/CIM-Config/cim.properties]...
But still the line throws 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.myorg.cim.CIMConfiguration.configure(CIMConfiguration.java:104)
at com.myorg.cim.CIMConfiguration.configure(CIMConfiguration.java:89)
at com.myorg.cim.InterfaceJob.execute(InterfaceJob.java:64)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)


This code is called from Quartz scheduler And the properties file exists and the path is correctly passed.
Still it throws this error "sometimes". It is not reported always so no idea how to reproduce the issue


Any thoughts ??

Thanks & Regards,
Ranbir
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there and welcome to Javaranch!

I'd attach a debugger to this (first make sure that you ahve the source code for this library downloaded) and see what happens inside config.load(), e.g. See if for some reason it loses the URL and/or makes the URL invalid by altering it somehow.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!