I would Like to print Exceptions to an agent Log not a console

I purposely set this error so my agent would produce the error. The error listed below prints to the Java Console in Lotus Notes. I would like it to print to an agent.log I know this can be done through the use of a StringWriter and e.printStackTrace(StringWriter). But I need some documentation. Can anybody help??
Below is a snippet of the agent and the error follows.
} catch(Exception n) {
System.out.println("Error Caught");
System.out.println("Error Message" + " " + n ); //+ " " + el + " " + n.getMessage());
n.printStackTrace();
[FATAL ERROR] notes:///__86256D7B000B5CD1.nsf/0/CA2EA717D0E3594686256DAD005B7E7D(XMLBody) Line:16 Column:36: "</connectduration>" expected.
Error Caught
Error Message "</connectduration>" expected.
"</connectduration>" expected.
     at com.ibm.xml.framework.XMLParser.handleError(XMLParser.java:413)
     at com.ibm.xml.framework.XMLParser.error1(XMLParser.java:485)
     at com.ibm.xml.internal.DefaultScanner.emitError(DefaultScanner.java:312)
     at com.ibm.xml.internal.DefaultScanner.scanContent(DefaultScanner.java:1195)
     at com.ibm.xml.internal.DefaultScanner.scanDocument(DefaultScanner.java:419)
     at com.ibm.xml.framework.XMLParser.parse(XMLParser.java:329)
     at com.ibm.xml.parsers.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:1069)
     at lotus.domino.Parser.parse(Parser.java:49)
     at lotus.domino.local.Item.parseXML(Item.java:571)
     at ParseEvents.NotesMain(ParseEvents.java:41)
     at lotus.domino.AgentBase.runNotes(AgentBase.java:161)
     at lotus.domino.NotesThread.run(NotesThread.java:203)

If you have a log file created and want to log the stacktrace in it you can get the stacktrace as a String & write it to the log file:
    public static final String getStackTrace(Exception e)
        if (e == null)
            return null;
        StringWriter sWriter = new StringWriter();
        PrintWriter pWriter = new PrintWriter(sWriter);
        e.printStackTrace(pWriter);
        //String stackTrace = new String(sWriter.getBuffer());
        String stackTrace = sWriter.toString();
        pWriter.close();
        try {
            sWriter.close();
        catch (IOException ie) {
        return stackTrace;
    }

Similar Messages

  • I have an IPAD 2 and would like to print to my mobile printer HP 470.  Can I do this through the cable? What do I need to do?

    I have an IPAD 2 and would like to print to my mobile printer HP 470.  Can I use the patch cable?  What do I need to do?

    iOS AirPrint Printers  http://support.apple.com/kb/HT4356
    How to Print from Your iPad: Summary of Printer and Printing Options
    http://ipadacademy.com/2012/03/how-to-print-from-your-ipad-summary-of-printer-an d-printing-options
    Print from iPad / iPhone without AirPrint
    http://ipadhelp.com/ipad-help/print-from-ipad-iphone-without-airprint/
    How to Enable AirPrint on a Mac and Use Any Printer
    http://ipadhelp.com/ipad-help/how-to-use-airprint-with-any-printer/
     Cheers, Tom

  • TS3147 I would like to print pdf architectural plans in the scale they were intended how can I do this?

    I would like to print architectural plans to scale from a pdf.  How can I do this?  Even just a section of the plan.
    thank-you

    Did you try Google?
    https://www.google.com/search?q=print+architectural+plans

  • I have a Mac and use an EPSON NX510 printer. I would like my printer to only print in black ink unless I otherwise indicate. How do I do this?

    I have a Mac and use an EPSON NX510 printer. I would like to print in black ink only and cannot locate how to do this?

    You usually find an option to print in black and white or gray scale in the settings of your printer that come up  when you choose "print" in the file menu of the program you are using at the time.
    BUT, if what you want to do is print with only black ink because you are out of ink in one of the color cartridges, that is usually not possible. For some reason I can't remember, printers makers prevent the use of the printer as soon as one of the color cartridges is empty.

  • I would like to print a page from a book bought on Amazon.  How can I do that?

    Dear Support Community:
    I bought a digital book on Amazon.com, and downloaded it to my iPad.  It is in the KINDLE app.  I would like to print a page or two of it on the printer connected to my lap top.  Am having a devil of a time.  can anyone help?   I think I can do it, but just don't know how. Please help?
    thanks.
    Gary

    I've never tried to print a book page directly, so don't know if it is possible.
    But you could do this.
    How to take a screenshot on your iPad
    http://www.imore.com/screenshot-ipad
    And then print the pic.
     Cheers, Tom

  • I would like to print out the icon and title of each of my apps to another document for printing and sharing within my family

    I would like to print out the icon and title of each of my IOS apps to another document for printing and sharing within my family.  My son has my old iPod touch so I erased it so he could put whatever games he wants to play on that I used to play with.  It is difficult to download every game at one time because there is too much to download at one time.  I have many hundreds of apps.  One way I found was to create a screen grab of each page in iTunes  then open it in Preview contact sheet but that is really tiny unreadable image of each screen.  I also tried importing a screen shot of the contact sheet into Paint 2 and magnifying it on several pages but that is really blurry.  The ideal solution would be to import the icon and text to another app or to provide a print list of apps solution within iTunes.

    Create iPad screen shots by briefly pressing the home and on/off buttons together.  You will hear a shutter click sound and find a screen shot on your iPad's Camera Roll.  You can then print these screen shots as you would any iPad photos.
    UPDATE: I assumed you had an iPad.  Hopefully your iOS device does have an on/off and home button and is capable of producing screen shots.

  • Swing , would like to print hello inside of the frame, how?

    i would like to print hello inside of the frame, how can i do that?
    import java.awt.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import java.awt.Toolkit;
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class Main extends JPanel
    implements ActionListener {
    JButton button;
    public Main() {
    super(new BorderLayout());
    button = new JButton("Click Me");
    button.setPreferredSize(new Dimension(200, 80));
    add(button, BorderLayout.CENTER);
    button.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
         System.out.println("hello");
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("welcome");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    JComponent newContentPane = new Main();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }

    Recommended lessons in this context: [Using Layout Managers|http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html] and [Painting in AWT and Swing|http://java.sun.com/products/jfc/tsc/articles/painting/]
    If the second lesson is a little heavy, look at this light version: [Performing Custom Painting|http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html]
    Edited by: Andre_Uhres on Aug 24, 2008 8:34 AM

  • I have an Iphone 4S and I would like to print my text messages, including the thread and the Imessage date and time stamps.  How would I do this?

    I have an Iphone 4S and I would like to print my text messages, including the thread and the Imessage date and time stamps.  How would I do this?

    settings - message - imessage - OFF

  • I would like to print a four sided programme, but am having trouble finding out how to organise the sections onto a 17  by 11 paper with the sections in the right order. Any help?

    I would like to print a four sided programme, but am having trouble finding out how to organise the sections onto a 17  by 11 paper with the sections in the right order. Any help?

    If all you are going to do is print double sided and them make
    a single fold reducing the page to 8 1/2 x 11, one side of the
    original 17 x 11 page will be page 4 on the left as you hold
    the page facing you and page 1 on the right, reverse side
    should be printed so top is same as top on the the first side
    and will be page 2 to the left and page 3 to the right. Pick
    up the double sided document with pages 2 and 3 facing you, fold
    left edge to meet right edge; you should now have fold on the left
    with page 1 facing up toward you, turn the page as you normally
    would and pages 2 & 3 should be in order, and one more turn brings
    you to page 4 and the fold should know be on the right. I hope this
    explains clearly enough - if not, post back and some one should
    join in with a better explanation.

  • I would like to print my Pages document on Matte Photo Paper

    I would like to print my Pages document on Matte Photo Paper which is in the rear feeder of my Canon Pixma MX882 printer. The print function in Pages/Yosemite does not give me that option.The only options are to print on plain paper from the cassette. When I print images from iPhoto, I have more paper options. When I try to convert the doc to a jpeg, with Graphic Converter so I can drop it in iPhoto, the result is very blurred almost unreadable.

    Have you gone to Canon's website and downloaded the very latest Printer Driver for your Model?
    Also have you looked amongst the paper handling options in your Print dialogue for the rear feeder option.
    What is stopping you putting the high quality paper in your regular paper cassette?
    Peter
    Here is the link for the Yosemite driver:
    http://www.usa.canon.com/cusa/support/consumer/printers_multifunction/pixma_mx_s eries/pixma_mx882#DriversAndSoftware

  • I would like to print addresses on envelopes from my ipad contact list

    I would like to print addresses plus my return address on envelopes using ipad contact list.  I do not have a wireless printer so would have to export file to be able to use in some way on my pc.  Is  this possible?  Thanks  Pam

    Hello FeyQueen,
    You may be able to remove existing game data by via the following:
    On your iOS device, go to Settings > iCloud, then tap Storage & Backup.
    On your Mac, go to Apple () menu > System Preferences, click iCloud, then click Manage.
    On your Windows computer:
    Windows 8.1: Go to the Start screen and click the down arrow in the lower-left corner. Click the iCloud app, then click Manage.
    Windows 8: Go to the Start screen and click the iCloud tile, then click Manage.
    Windows 7: Choose Start menu > All Programs > iCloud > iCloud, then click Manage.
    Once in the 'Manage' dialog, look for the name or icon of the affected game. If present, you should be able to delete any data the game has saved to your iCloud account.
    Managing your iCloud storage
    http://support.apple.com/kb/HT4847
    Cheers,
    Allen

  • Would like to print from laptop to printer at home. Printer is ethernet connected to NetGear Router

    HP PAvilion dv1000, Windows XP
    Would like to print from laptop to printer at home.  Printer is ethernet connected to NetGear Router.
    I had been able to print wirelessly from laptop to HP 7310 Officejet all-in-one, but now all I get is "document failed to print" message.  I can get documents to print on this printer using my smart phone, but not the laptop.
    I have used "find printer" button on print screen and can see the printer to select.
    Any suggestions?
    This question was solved.
    View Solution.

    Figured it out after looking at a few other posts...
    Configured port to printer IP Address and now it is printing perfectly.
    Thanks for having posts out there to review.

  • My wife has an original iPad and would like to print her contact list.  How can we do this?

    my wife has an original iPad and would like to print her contact list.  How can we do this?
    [email protected]

    Make groups of contacts in your Address Book and select the option to sync only selected groups to each phone.
    This explains how to create groups:  Mac 101: Address Book, http://support.apple.com/kb/ht2486

  • I would like to print shipping labels (Avery 8163) with same info in each label.

    I would like to print mailing labels (Avery 8163) with the same info in each label. Where do I get the template & how do I duplicate address info into all 10 boxes?

    You can get the label templates from Avery. You can use a tempalte for Word. In Pages check show Layout in the View menu to see the grid.
    Create one label > Group the objects > Cmd + Drag to duplicate the label

  • I HAVE A MAC NETWORK WITH A HP LASER-JET AND EVERYTHING IS WORKING FINE.  I ALSO HAVE A WINDOWS BASED MACHINE THAT I WOULD LIKE TO PRINT TO AS WELL.  HOW CAN I ACCOMPLISH THIS?

    I HAVE A MAC NETWORK WITH A HP1200 LASER-JET AND EVERYTHING IS WORKING FINE.  THE PRINTER IS CONNECTED DIRECTLY WITH ONE OF MY MAC-MINI"S.  I NOW HAVE A WINDOWS BASED PC AND WOULD LIKE TO PRINT TO IT AS WELL.. HOW CAN I DO THIS?

    Make sure that you Printer Sharing enabled on the Mac Mini.   System Preferences > Sharing > Printer Sharing
    Do the same on the PC
    On the PC, try downloading and installing Bonjour Print Services for Windows v2.0.2
    Run the application on the PC to see if it will discover your printer and install the printer.

Maybe you are looking for

  • CFDocument and trouble converting to pdf

    Hello, I'm simply trying to convert a word doc to .pdf using CF9.  But when I try it, I get the following error... 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. Also, coldfusion ser

  • HT3275 What does sparsebundle already in use mean?

    I have two Macbook pros in use on this time capsule.  I only get this message from one of the laptops.  Any suggestions?

  • N8 Low memory Error - Belle

    Hi, I am happy with the dynamic change brought to Symbian OS such as Anna and now Belle, however, have a issue repeating from past few days. I have mail for exchange configured and whenever I miss any meeting, it shows in the slide down window (Quick

  • Newbie to SQL Developer

    I am new to the Oracle SQL Devloper world. Does anyone have any self-taught URLs or any "Tricks and Trades" URL for Oracle SQL Developer??? One specific question I have is how do you get to the last record in a result set. I know in SQL Navigator the

  • Copying PO STO currency to Accounting Document

    Hi, Do you have any idea how I can copy the PO STO Currency to Accounting Document in VF01? I managed to copy the PO STO currency to the billing document by using USEREXIT_PRICING_PREPARE_TKOMK. Now I need to make sure that the accounting document wi