Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error:javax.xml.transform.TransformerException: java.io.FileNotFoundException: file:\C:\Documents%20

 
kiran purohit
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am try to convert java obj to xml file and i an getting below error please guide me, error and the code is mentioned below.

error:javax.xml.transform.TransformerException: java.io.FileNotFoundException: file:\C:\Documents%20and%20Settings\kiranain\Desktop\fop-0.20.5\.\out\ResultObj2XML.xml (The filename, directory name, or volume label syntax is incorrect)


code-



Thanks
Kiran purohit
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added code tags and you can see how much better the post looks
Why have you got a dot in the middle of your file path?
Why are you using System.exit? That looks unnecessary in that location.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags while posting. It makes the code way better to read.

The FileNotFoundExcpetion clearly tells the system cannot find the file C:\Documents%20and%20Settings\kiranain\Desktop\fop-0.20.5\.\out\ResultObj2XML.xml

Is there a specific requirement to create a folder with just a period as it's name? I see we cannot have a directory with just period as it's name in Windows. Remove that part and try again.
 
kiran purohit
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rancher,

I tried using name instead of dot(period),however i am getting the same error, dot was just part of the program i downloaded, however other programs(converting xml to FO and FO to pdf) is working fine, with same dot operator, however in error message it says that the file name, directory name or label might be incorrect.

kiran Purohit
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the below line does?

How is the Source created? If you cannot understand the program, then please start writing a new program from scratch to transform a Source to XML.
 
kiran purohit
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,



Here i am converting java object to source object which intern is an input to the JAXP Transformation, however the code to convert java object to source object is not a part of the code which i have posted.

Regards
Kiran
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic