javax.xml.transform.TransformerException

V

veny

Hi guys & girls,

I am working on an application which will take all the required
configuration from MAIN xml file and update those in the nearly 8 xml
files. In the process, I was successfull implementing on the windows
platform but when I want to do the same application on UNIX I am
having problem with the paths. Though I am imposing the absoulte path
for the newly created xml files using transformer object, I am ending
up with

"javax.xml.transform.TransformerException:java.io.FileNotFoundException:
usr/local/Edre/adminserver/AdminServerConfig.xml (A file or directory
in the path name does not exist.)"

As you can see the path doesn't start with "/usr/local/..." but starts
with "usr/local/...". I have no clue why this exception is thrown
eventhough I am creating a file with absolute path. see the snippet of
the code below,

Source source = new DOMSource(doc);
File file = new File(filename);
File file1 = file.getAbsoluteFile();
Result result = new StreamResult(file1);
Transformer xformer = TransformerFactory.newInstance
().newTransformer();
xformer.transform(source, result);
}catch (TransformerConfigurationException e) {
System.out.println("TransformerConfigurationException
: " + e);
}catch (TransformerException e) {
System.out.println("TransformerException : " + e);
}

Can anyone let me know where I am doing wrong. Anyhelp in this matter
would be greatly appreciated and thanks in advance.

veny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top