Affects Version/s: 1.2
Fix Version/s: None
Operating System: Windows XP
When the locate method attempts to find resource location from the context classpath
(lines 375-384 in ConfigurationUtils.java) it fails (on line 378) if the context
ClassLoader cannot be retrieved for the current thread.
I suppose this bug is quite difficult to reproduce. I came accross it when I and a
colleague of mine were testing a Java API (kept in one jar) that is called from C++
application. In the static initializer of a Java class I used the next line to load
config = new PropertiesConfiguration(ConfigurationUtils.locate("properties/routing.
It worked fine if the class was used from another Java class that was normally loaded
by JVM (for example my tests passed). But when my Java classes were executed by JVM
started from C++ application it resulted in the next exception:
It is obvious from the ConfigurationUtils code that loader variable got null value
(line 377) for some reason so the next step threw the exception.
I suppose this bug can be easily fixed (just to add an additional check if loader is
As a workaround I will try to call locate method with a given base parameter (but it
needs to determine location of my jar so it is a kind of overheads though it would
work I hope).
Sorry for my English.
Hope it is useful,