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
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