Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javax.xml.transform.TransformerException: java.io.FileNotFoundException:

843834Oct 24 2005 — edited Nov 24 2008
The following code compiles and runs fine on java 1.4.2
Result result = new StreamResult(outFile);
Source source = new DOMSource(document);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.setOutputProperty(OutputKeys.METHOD, "xml");
xformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); 
xformer.setOutputProperty(OutputKeys.VERSION, "1.0");
xformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
xformer.setOutputProperty(OutputKeys.INDENT, "yes");
xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
xformer.transform(source, result);
But when I compile and run it on java 5.0 I get a
javax.xml.transform.TransformerException: java.io.FileNotFoundException:
in the last line of the code.

Can anyone help me out?
Many thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2008
Added on Oct 24 2005
8 comments
3,632 views