javax.xml.transform.TransformerException

Discussion in 'Java' started by veny, Oct 25, 2004.

  1. veny

    veny Guest

    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
     
    veny, Oct 25, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    400
  2. Replies:
    1
    Views:
    762
    Esmond Pitt
    Mar 27, 2005
  3. Andreas
    Replies:
    1
    Views:
    947
    Raymond DeCampo
    Sep 4, 2005
  4. Robert Kattke
    Replies:
    2
    Views:
    4,936
    Robert Kattke
    Apr 21, 2004
  5. Abdelhalim
    Replies:
    2
    Views:
    1,072
    Tom Hawtin
    Jul 6, 2007
Loading...

Share This Page