Print exception in a file

We have finished a project in java. However, my God need the exception written in a file.I need the re-orientation method .for example
java xmost.xcweb.startup.Run > log.txt.
the standard output messages were printed in the log.txt file.but the exception cannot written in this log file, can anyone give me useful advices?
Thanks.

The standard error stream, System.err, can be set programmatically through java code by calling System.setErr. This is useful since on win9x it's impossible to redirect sdterr with "2>" for some reason or another...

Similar Messages

  • Will not print anything but Pdf files!

    If I try to print anything at all other than a PDF file from Adobe only(other readers will not even work) very little of the page prints if anything at all. For example, I was trying to print a shipping label off of the website, and the only thing that would print was the barcode. Nothing else. I actually had to convert it to a pdf file and open it with Adobe, and then it printed perfectly. I have tried reinstalling, restarting, using the HP support doctor, which says absolutely nothing is wrong with my printer. I am at a loss to why it will only print pdf files from Adobe. Can anyone please help me?! I forgot to mention it worked perfectly about a month ago. We don't print a whole lot and didn't notice it was messed up until just a few days ago.

    Hey , Welcome to the HP Support Forums!
    I understand that when printing from your Windows 8.1 computer to your HP Deskjet 1512 All-in-One Printer, nothing is printing, except Adobe PDF files. I would like to assist you today with resolving this issue. Now, you indicate in your post that you had tried to print a shipping label from a website, and only the barcode prints. However, if you open the file up and print it from Adobe it appears to print fine. This leads me to believe that the actual issue that is occuring is a print system issue with the black cartridge. I know it may come as a surprise to hear that as Adobe is printing fine. However, when you print from certain programs on your computer the file is sent to the printer as an 'image' file. If your printer 'thinks' it is printing an image it will use a mixture of colour ink and black to print the black document. Therefore, what you may actually be seeing when you print from Adobe is colour ink mixed. To start troubleshooting I am going to have you print a Quality Diagnostics Report from your printer and this will help us to isolate this printing issue. Please follow the steps below.  How to Print a Quality Report: Load clean, white U.S. Letter or A4 paper in the input tray, if necessary.Press and hold the Power button. While holding down the Power button, press and hold the Cancel button. Hold them both down for 2 or 3 seconds.The test page prints. (1) Printed with the tri-colour cartridge(2) Printed with the black cartridge  If this Report prints perfectly: Then the printing issue that you're experiencing is not being caused by your products print system. Rather, there may be a driver conflict occuring between your Windows computer and your printer. Please do not proceed with troubleshooting at this time.  If this Report prints with missing black or other quality issues: Then the printing issue that you're experiencing is being caused by your products print system. To resolve this hardware issue can I please have you click here. Once the support document opens please choose the Windows 8 dropdown. Next, follow the steps under Solution one, Solution five, Solution six, and Solution seven. This includes any sub steps under the listed Solutions to complete. Once troubleshooting has been completed please print another Quality Diagnostics Report to confirm if the issue has been resolved. Please respond to this post with the result of printing the Quality Diagnostics Report. I look forward to hearing from you!

  • Reg:printing contents to log file

    Hello all iam creating a debug log file for my program.. debug will be based on the level set which will be taken as a input from the user ..when i try to print the contents to a file gen.out i could not print anything ..file is empty..can some one pls help me ..there is no error thrown by the program
    // my main propram
    public class ff {
      public static void main(String[] args) {
        PrintStream out = System.out;
        int dbgLevel = Integer.parseInt(args[1]);
        String path ="gen.out";
        debug.setLevel(dbgLevel);
        try {
            debug.setLogFile(path);
        catch(Exception e1) {
          e1.printStackTrace();
    debug.msg(0, "Printing contents to a file  ");
    if (Debug.allowed(0)) {
                    Debug.msg(0, "1.printing th econtents );
    //debug class
    public class debug {
      private static int ourLevel = 0;
      private static FileWriter c_writer;
      private static final String k_nl = System.getProperty("line.separator");
        public static void msg(int reqLevel, String debugMessage) {
        if (reqLevel <= ourLevel) {
          String s = "DBG(" + reqLevel + ") " + getTS() + " " + debugMessage + k_nl;
          if (c_writer == null) {
            System.out.println("writer is null "+c_writer.toString());
            System.err.println(s);
            System.err.flush();
          else {
              System.out.println("writer is not null "+c_writer.toString());
              try {
                         c_writer.write(s);
            catch (IOException e) {
                e.printStackTrace();
          } // if (c_writer...) else ...
        } // if (reqLevel...
      } // msg()
    public static void setLogFile(String path) throws IOException {
        c_writer = new FileWriter(path);
    public static void setLevel(int l) {
        ourLevel = l;
        public static boolean allowed(int reqLevel) {
        return reqLevel <= ourLevel;
    file is getting created but its empty ..wat am i doing wrong here .?

    thanks mkoryak got it i was flushing a wrong stream
    thanks for the help

  • Cannot print a simple Text File

    Hello All,
    I wrote the following program
    import java.io.*;
    import java.awt.print.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    public class TestPrint
         public static void main(String[] args) throws Exception
              FileInputStream fis = new FileInputStream(new File("pds.txt"));
              byte[] fileByte = new byte[34];
              int read = 0;
              int counter = 0;
              while((read = fis.read()) != -1)
                   fileByte[counter++] = (byte)read;
              PrintService services[] = PrinterJob.lookupPrintServices();
              DocFlavor flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
              PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
              aset.add(MediaSizeName.ISO_A4);
              aset.add(new Copies(1));
              Doc doc = new SimpleDoc(fileByte, flavor, null);
              DocPrintJob pj = services[0].createPrintJob();
              pj.print(doc, aset);
    }The file I am trying to print is a simple text file. My requirement is to convert it to an array of bytes and then print it.
    However I get the exception
    Exception in thread "main" java.lang.IllegalArgumentException: data is not of de
    clared type
    at javax.print.SimpleDoc.<init>(Unknown Source)
    at TestPrint.main(TestPrint.java:25)
    Please help me. I would appriciate any help in this matter.
    regards,
    Abhishek.
    PS: The contents of the file (pds.txt) which I am trying to print is
    PDS
    pds
    pds
    pds
    pds

    Hi,
    you get a java.lang.IllegalArgumentException in line 25:
    So we take the Java API for SimpleDoc:
    IllegalArgumentException - if flavor or printData is null, or the printData does not correspond to the specified doc flavor--for example, the data is not of the type specified as the representation in the DocFlavor.
    Since fileByte seems not the be null, the type must be wrong!
    In line 21 we see:
    DocFlavor flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
    so fileByte must be type java.io.InputStream, which it isn�t. This causes your IllegalArgumentException.
    So try in line 21:
    DocFlavor flavor = DocFlavor.BYTE_ARRAY.TEXT_PLAIN_US_ASCII;
    Let me know if that was the reason!
    Best regards
    Martin

  • While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra positi

    While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra position and also pdf generated from this word file also contains the same.

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • How can I print mulitple different .ai files onto one page in Illustrator CS6?

    How can I print mulitple different .ai files onto one page in Illustrator CS6? I have all of the files organized by Arrange Documents>Tile All in Grid and I would like to print the files in this format so that they can all be seen at once when printed out onto one page.
    Some background is that I have 16 different cad drawings that I have converted and edited in illustrator. I'd like to basically make a contact sheet with all 16 drawings so that they can be reviewed on one sheet of paper after printing. But each drawing is in it's own unique file, and I have not figured out how to put them all onto one page for printing.

    You can place them (linked) into a new Illustrator file and print from there.
    The original files will need pdf compatability.

  • Is there a way to print multiple Indesign CS6 files...

    ...via a script or plug-in?
    I periodically have to print many separate indesign files, and I'd like to be able to drag them to a droplet, or script on my desktop instead of opening each one individually and printing that way.
    Thanks,
    Scott

    Create a book file (File > New > Book). Add the files to the book. Deselect all the files in the book file (none highlighted), then choose Print Book from the book panel menu.
    Of course, all the files will print with the same print settings.

  • Hp laserjet pro 200 My won't print more than 1 file at a time

    My hp laserjet pro 200 m251 won't print more than 1 file at a time. Any ideas?

    Hi @nocastaway,
    I see by your post that you can't print multiple copies. I can help you with this.
    From the application your printing from, go to File, Print, Number of copies select 2. Uncheck Collate. You can now change the number of copies. Collate should now stay unchecked.
    Try printing the multiple page document again.
    You might have to disable all the startup items, to see if there is another program causing this issue.
    How to use MSCONFIG. Click on the Startup tab and disable all.
    Test the printer.
    Then go back in and enable all from the Startup tab.
    Download and run the Print and Scan Doctor if you are still having issues. It will diagnose the issue and might automatically resolve it. Find and fix common printer problems using HP diagnostic tools for Windows?
    What applications have you tried?
    How is the printer connected? (USB/Ethernet/Wireless)
    What operating system are you using? How to Find the Windows Edition and Version on Your Computer.
    What were the results when you ran the Print and Scan Doctor? (did it print or scan, any error messages)
    If you need further assistance, just let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • [Applet]Printing issue with pdf files on Xerox 4595

    Greetings !!
    I'm trying to print to a Xerox 4595 printer from a Windows XP station (limited account) using a Java Web Applet.
    This applet generates pdf files which have to be printed.
    The Xerox 4595 uses a printing queue that is detected by the Applet.
    The problem is the following: usually when printing a simple local file from this computer there is a box that asks you your login to let you create a job and then print.
    When using the Java Applet, there is no way to have this print box displayed. We have the Java Print Dialog but once clicked on "Print" there is no box displayed to pass the login to the printer and let us print.
    Is anyone already worked with Xerox 4595 and experienced such issue ?
    How can I, using the Java language and modify the Applet, ask the printer to send me the dialog box asking for the login ? Without this login no jobs are accepted and we can't print the generated pdf files.
    I looked on the printer queue settings and it seems that the Xerox uses the IPP to communicate with the local computers in the office.
    The server from which the Applet is used is a openSuSE Linux Web server (apache2)
    How come using Linux workstations any pdf files are printed (on shared printers such HP laserjet) and under windows there is jammed characters and sheet feed instead ?

    A lot can depend upon which app your are using on your tablet device, the same applies to computer programs but apps are much worse.
    Which app are you using?
    I would try the free Adobe Mobile Reader. This product seems to support more features than other apps.
    There could even be issues with the type of tablet you are using. The Apple line may work better then Android devices since there is QA check and approval by Apple.
    Another factor is the how the PDF was created.
    How well are the maps displayed on your laptop or desktop? Try different values of zoom.

  • How to show print Preview of an file in java

    Hi,
    Suppose i have a file like "bina.xls". Now i want to see the print preview of this file from java code. How is this possible? I s there anybody can help me? now i am in serious trouble with this? I can generate an excel file. But i can not show this file with JExcelApi. i can know that this is possible with jasper report, how this is possible with Jasper Report ? if any one help me with sample code then i will be very gratefull to u . Please help me.
    With Regards
    Bina

    This forum is exclusively for Sun Java Studio Creator. Please post your queries on appropriate forums to have better discussions :
    e.g.
    Java Technology Forums - Java Programming :
    http://forum.java.sun.com/forum.jspa?forumID=31

  • How to Print Screen as a File on MacBook Pro Using Bootcamp 5.0 on Windows 8.1

    I know print screen on a MBP is Shift + Fn + F11, but I want to print screen as a file. I tried Shift + Fn + F11 + Command but it doesn't work. Does Bootcamp support this feature?

    In Windows, you can use a third-party application or a good solution would be to use the On-Screen keyboard included in Windows. That keyboard has got the Imp Pant key, that allows you to copy a screenshot of the whole display.
    Then, open Paint and press Control and V keys to paste the screenshot. Finally, close Paint and save the screenshot as a file.
    Note that third-party applications may offer you a faster way of doing that

  • Can' t print a pdf/a file in adobe reader for mac

    Can' t print a pdf/a file in adobe reader for mac

    You should try looking at this document: http://helpx.adobe.com/acrobat/kb/printing-tips-acrobat-reader.html

  • Used to be able to print multiple page pdf files on my HP 7310 all in one and then it stopped and would only print the curent page. This is tedious for long PDF docs. I am on 10.6.8 .

    Used to be ablert to print multiple page pdf files on my HP 7310 all in one printer and now I can only print the current page and therefore it takes forever printing them one by one. I am in version 10.6.8. Tried printing as image using the advanced click and that did not work either.  I have Adobe 9.0 reader installed.

    I tried this earlier, and I tried it again today.  Both times it said "Software Missing!"  and "HP Software required to connect to your printer over the network could not be found on this computer."  But when I tried to install the software (AIO_CDB_Net_Full_Win_WW_130_141.exe, which I downloaded from HP's web site), it wouldn't install, as described above.  In the diagnostic utility, I clicked "skip", and it said "Connection Verified!", and "The printer is connected to the network and the services related to the network connections have been verified and reset to a normal operating state.  Everything appears to work fine at this point.  Please doa test print to verify that the issue is resolved or click Skip to move to the next step."  I clickedthe "Test Print" button, and immediately it popped up a box that said "Test Print Failed."
    I tried again to install the HP software, and it installed, detected the printer, and asked me to select it.  I selected the printer, clicked "next", and it did its network diagnostics.  Then it said "Problem(s) found with your network" and "Problem(s) may exist with the network functions of your printer . . ."  I continued the installation without connecting to the printer.  Then I ran your network printer diagnostic tool again, and got the same result - "HP Software required to connect to youir printer over the network could not be found on this computer."

  • Printing messages in Log File and Output File using Dbms_output.put_line

    Hi,
    I have a requirement of printing messages in log file and output file using dbms_output.put_line instead of fnd_file.put_line API.
    Please let me know how can I achieve this.
    I tried using a function to print messages and calling that function in my main package where ever there is fnd_file.put_line. But this approach is not required by the business.
    So let me know how I can achieve this functionality.
    Regards
    Sandy

    What is the requirement that doesn't allow you using fnd_file.put_line?
    Please see the following links.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Dbms_output.put_line+AND+Log+AND+messages&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=%22dbms_output.put_line+%22+AND+concurrent&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

Maybe you are looking for

  • Integration process in File to BPM Scenario

    hi,      gud morning. i got a problem while designing a BPM. in designing the integration process in IR, i am not able to get both the abstract interfaces to select from,  while defining the container. plz post a solution for this. thank u.

  • Context Problem

    Hi , I addEnviornment details to Context object as soon as user logons to the application . The user is validated against Weblogic Integration Server and then context is made and store in Session. I pass this context object to make a lookup on a sess

  • Where do I find upgrades for my imac G4, 800 mhz for OSX?

    I have an IMAC G4 that is currently running OS X 10.2.8 I need to upgrade my safari since it mis-reads some pages when using this IMAC. But I can't upgrade safari unless I can upgrade the OS X. I can find upgrades for 10.3.9 but can't install without

  • Small method probrem

    Hi i'm rather new on Java, and i got a small problem with methods: class Metodus1 {   byte life;   String status;   void fight() {     if (life <= 0) {       status = "You're dead";       System.out.println(status + "");     else {       status = "Yo

  • 10.2.1 many issues

    I have down loaded version 10.2.1.2122. There seem to be a done of issues 1). Video recording freezes while recording. 2). You can send pictures if you begin a normal text and attach it, but if you are looking and a picture and select share and then