Link to home
Start Free TrialLog in
Avatar of dasvinay
dasvinay

asked on

properties.store() fails occassionally

Hi All,

I am not sure why, on some m/cs properties.store() fail to update and store the file. The same code works only on some m/cs. All are windows os. The file is not read-only and there is no other application using it. Only String values are used for keys and values. Any input on occassions where the store() might fail would be greatly appreciated


Thanks
Avatar of Mayank S
Mayank S
Flag of India image

Make sure that the properties-file has not been opened by the same application elsewhere (ensure that you close all streams in finally blocks).
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> properties.store() fail to update and store the file
what Error/Exception do you get ?
Avatar of dasvinay
dasvinay

ASKER

Thanks for the quick reponse !

Yes, No other application or a service or any instance of the same application are open. The system is rebooted. This is the first action taken ie to update the properties file and it fails..


Thanks
Do you close the InputStream?
Sorry - didn't see those replies when i posted
Good idea, I will synchronize the read/write. this might help.

Thanks everyone