• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue in saving XML data to file

 
Senthamarai Prabhu
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have method to write the XML Document to the file, Which is shown below



I am getting the following exception occasionally

java.io.FileNotFoundException: D:\data.xml (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)


I used to call this method multiple times, 10% of times I used to get this exception

Please help to resolve this issue

Thanks
S Prabhu
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FileOutputStream.open() will throw a FileNotFoundException in various situations. The most likely causes are the file exists, but is read only, or the path is inaccessible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic