commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Putnam <>
Subject Re: [configuration] Re: CompositeConfiguration Checking Existence of Properties.
Date Wed, 31 Oct 2012 16:47:20 GMT
Hi Greg,

Not quite. I don't have any keys set yet so I don't know about the first 
line. I am only at the beginning of this and my first step was to 
determine if a property exists and if not set it. I switched back to 
using 'getString' but have the same exception. FWIW, here is the full 

Exception in thread "main" java.lang.NullPointerException
     at KCBSConfig.getProperty(
     at ImageTest.main(

Just to be sure, I added an "if (config==null) .." to my code and it 
fails that so 'config' must contain something. If this is a Java issue 
rather than misuse of CompositeConfiguration, I'm stuck.

On 10/31/2012 12:24 PM, Greg Thomas wrote:
> On 31 October 2012 16:16, Dennis Putnam<>  wrote:
>> Thanks for the reply. I had 'getString' originally and got the same error
> So just to confirm,
> String foo = config.getString(keythatexists);
> String bar = config.getString(keythatdoesnotexist);
> is throwing a NullPointerException on the second line?
> If so, that sounds like a bug as it should only throw a
> NoSuchElementException - and that only if
> setThrowExceptionOnMissing(true) is called.
> Greg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message