Skip to Main Content

Java Programming

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!

java.io.FileNotFoundException but file exists!

807603Nov 27 2007 — edited Nov 27 2007
Hi all, I'm getting the following error when I update one .xml file:

Error Details:
com.altova.xml.XmlException: java.io.FileNotFoundException: file:\C:\sfas100\server\logs\users.xml (The filename, directory name, or volume label syntax is incorrect) at com.altova.xml.Document.internalSave(Document.java:219) at com.altova.xml.Document.save

C:\sfas100\server\logs\users.xml exists in my local folders (Windows)

I didn't add "file:\" prefix anywhere, I guess is addes automatically by Stacktrace error

Thanks!
T

Source code:

**internalSave**(
new javax.xml.transform.stream.StreamResult(
new java.io.File(filename)
),
node.domNode.getOwnerDocument(),
encoding
);


protected static void internalSave(javax.xml.transform.Result result, org.w3c.dom.Document doc, String encoding) {
try {
javax.xml.transform.Source source
= new javax.xml.transform.dom.DOMSource(doc);
javax.xml.transform.Transformer transformer
= javax.xml.transform.TransformerFactory.newInstance().newTransformer();
if (encoding != null)
transformer.setOutputProperty("encoding", encoding);
if (doc.getDoctype() != null) {
if (doc.getDoctype().getPublicId() != null)
transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_PUBLIC, doc.getDoctype().getPublicId());
if (doc.getDoctype().getSystemId() != null)
transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM, doc.getDoctype().getSystemId());
}
transformer.setOutputProperty("indent", "yes");
transformer.transform(source, result);
} catch (javax.xml.transform.TransformerConfigurationException e) {
throw new XmlException(e);
} catch (javax.xml.transform.TransformerException e) {
throw new XmlException(e); *//It enter in this catch*}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2007
Added on Nov 27 2007
12 comments
5,605 views