That should do!
Why are you catching Throwable?  This is bas practice as you will end up
catching run-time Errors in the VM as well as Exceptions.  I would catch
Exceptions only.

--JIv

-----Original Message-----
From: Nik DAMPIER [mailto:[EMAIL PROTECTED]]
Sent: 22 April 2001 13:32
To: [EMAIL PROTECTED]
Subject: DOM and the transformer interface??


Do I print the error message in my throwable object like this?

catch (Throwable e){
        System.out.println(e.getMessage());}


>From: "Kainth, Jivraj" <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>        Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: DOM and the transformer interface??
>Date: Fri, 20 Apr 2001 15:44:53 +0100
>
>You should try printing the error message in your throwable object rather
>than 'Bail out!!!'! That may give you a slight clue!  Print this to the
>error stream and check your servers logs.  Or alternatively, output a
>content type header to the standard out stream and then the error - this
>will display it in your web browser.
>
>-----Original Message-----
>From: Nik DAMPIER [mailto:[EMAIL PROTECTED]]
>Sent: 20 April 2001 15:25
>To: [EMAIL PROTECTED]
>Subject: DOM and the transformer interface??
>
>
>The problem is this I have now got my servlet (jswdk-1.0.1 because tomcat
>has/is cause me all manner of probs!) to invoke my createaccount method
>that
>reads in my XML file (thank to Zeng, Feng_Hua, cheers mate!) using the DOM
>and adds a new account to the DOM tree and writes (i.e save) the DOM tree
>back to the XML file. Now this works fine upto a call to the save method
>from createaccount method. I have tested the createaccount method and works
>when the createaccount method is not invoked by the servlet. So in theory
>it
>should work when called by the servlet?? But NO, things are not that
>simple,
>Well can anybody help:
>the code for save looks like this:
>public static void save() {
>try{
>1       DOMSource source = new DOMSource(doc);
>2       FileOutputStream outstream = new FileOutputStream("acc.xml");
>3       StreamResult result = new StreamResult(outstream);
>4       TransformerFactory transfac = TransformerFactory.newInstance();
>5       Transformer trans = transfac.newTransformer();
>6       trans.transform(source,result);
>         }
>catch (Throwable e) {System.out.println("Bail out !!!");}
>}
>Now I have traced the problem to line 6) and it is this line that throws an
>exception so the method bails out and doesn't work, well the output is a
>blank acc.xml because of line 2).
>
>So does any body know why this does not work??? can transformer interface
>not be used from the servlet or something??
>
>Can anyone give me a hint please??
>Nik
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to