java.lang.IllegalArgumentException: Null charset name

Hi,

I'm trying to read the Property file in path and then set them in System properties so that it will be accessible from my applicaiton.

Here is the code for same:

try

{

Properties props = new Properties();

File f = new File( absoluteFilePath);

System.out.println(" f " + f.exists());

props.load( new FileInputStream( absoluteFilePath ));

System.setProperties( props );

}catch(Exception e){}

But I keep on getting this exception for line " System.setProperties(props) "

java.lang.IllegalArgumentException: Null charset name

at java.nio.charset.Charset.lookup(Charset.java:376)

at java.nio.charset.Charset.isSupported(Charset.java:405)<Jan 30, 2004 6:37:21 PM PST>

at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:67)<Jan 30, 2004

at java.io.OutputStreamWriter.><init>(OutputStreamWriter.java:93)

But if I do

--

Enumeration enum = props.propertyNames();

while( enum.hasMoreElements() )

{

String key = (String) enum.nextElement();

String value = props.getProperty( key );

System.setProperty(key, value);

}

this works just fine. ( This makes my job done ! )

But I'm just curios to know why System.setProperites( Property Object ) doesn't work.

Can any body tell me what could be the reason ?

thanks,

rk

but i

[1451 byte] By [bardabaa] at [2007-9-29 22:50:37]
# 1
I am guessing that one of the keys in your file is incorrect. If you post the contents of the file this may help.
JElliota at 2007-7-16 3:13:47 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...