Java System.out Message on Solaris

Hi !
Could somebody tell me, how I can forward all System.out Messages from
my Java modules (EJB, Servlets) to the Solaris Terminal window?
Thanks Eddie

You could do a tail -f on the kjs console log. (Assuming that you only have one KJS).

Similar Messages

  • Capturing System.out messages

    Hey all,
    Just wondering what the easiest way to capture System.out messages of a process, and store these messages in an Array, Vector, or a Buffer where I could read these messages line by line later?
    Basically one process System.out.println()'s information I need to use as a variable for a second process. Any help would be greatly appreciated.
    Thanks!

    Here is a class which redirects standard out and err to a JscrollPane.
    import java.io.*;
    import javax.swing.*;
    public class EOutputConsole extends JScrollPane {
      Object lock = new Object();
      final JTextArea text = new JTextArea(10,30);
      PrintStream consoleOut;
      public EOutputConsole() {
        setViewportView(text);
        setupOutput();
       * An extention of PrintStream that notifies a lock
       * as it's executing its write method. This tells
       * an output console that it has input ready.
      class ConsolePrintStream extends PrintStream {
        Object lock;
        public ConsolePrintStream(Object lock, OutputStream out) {
          super(out);
          this.lock = lock;
        public void write(byte[] buf,
                          int off,
                          int len) {
          synchronized(lock) {
            lock.notify();
            super.write(buf,off,len);
       * A class that extends PrintStream to throw away all
       * input sent to it. This is used to supress standard out
       * and speed up test model runs with debugging output
      class NullPrintStream extends PrintStream {
        public NullPrintStream(OutputStream out) {
          super(out);
        public void write(byte[] buf,
                          int off,
                          int len) {
      public void suppressStandardOut() {
        // create a dumby temp file to use as an output stream
        // nothing will ever actually be written to the file
        try {
          File dumbFile = File.createTempFile("notme", "not1337");
          dumbFile.deleteOnExit();
          PrintStream out = new NullPrintStream(new FileOutputStream(dumbFile));
          System.setOut( out );
          System.setErr( out );
        } catch(IOException ioe) {
          System.out.println("Error supressing standard out");
          ioe.printStackTrace();
      public void availableStandardOut() {
        System.setOut( consoleOut );
        System.setErr( consoleOut );
      private void setupOutput() {
        Thread printer = new Thread( new Runnable() {
            public void run() {
              PipedInputStream pipe = new PipedInputStream();
              BufferedReader in = new BufferedReader
                (new InputStreamReader( pipe ));
              try {
                PipedOutputStream pipeOut = new PipedOutputStream(pipe);
                consoleOut = new ConsolePrintStream(lock, pipeOut);
                System.setOut( consoleOut );
                System.setErr( consoleOut );
              catch (Exception e) {
                System.out.println("Failed to create Pipe for System.out");
                e.printStackTrace();
                return;
              try {
                for(;;) {
                  while(!in.ready()) {
                    synchronized(lock) {
                      lock.wait();
                  text.append(in.readLine()+"\n");
                  verticalScrollBar.setValue(verticalScrollBar.getMaximum());
              } catch (Exception e) {
                System.out.println(e);
                e.printStackTrace();
        printer.setDaemon(true);
        printer.start();
    }

  • How to make add the program system.out messages to a applet text field?

    How to make add the program system.out messages to a applet text field?
    System.out.println("I wanna displany this message on a applet text field, thanks");

    You may wish to change the output destination to a JTextArea. Please have a look at this link that likely shows what you want:
    [http://forums.sun.com/thread.jspa?forumID=54&threadID=640376|http://forums.sun.com/thread.jspa?forumID=54&threadID=640376]
    If you need other examples, search the forum. I found the search terms -- redirect system out textarea -- very helpful.
    Good luck

  • Sun Java System Instant Messaging for windows xp

    Hi,
    We are in a project that uses Sun Java System Instant Messaging on Windows xp platform. But we didn't find the software download.
    Please tell how can i have that software?

    http://wwws.sun.com/software/download/products/4006ea75.html
    (this is an old version unfortunately)

  • JavaScript: calling Java system code message...

    When I try and call an applet function from Javascript, I get the following message in the output window:
    JavaScript: calling Java system code
    JavaScript: default security policy = file://
    ... and the method isn't called.
    Can someone tell me what I need to do please?

    Research pointers:
    http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1014290
    http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/js_java.html

  • Tomcat Java Servlets, how to log System.out.println() messages

    I have recently installed a new (x86) Mac OS Xserve, and am porting some Java application Servlets from an existing older Mac OSX server. All the servlets were working (I am connecting via port 9006). I have carefully used the old JDK 1.4 compiler, edited my server.xml (for port 9006) and web.xml files, etc. The Tomcat example servlets work fine, and all my (other) servlets work fine, with one exception, where I get the typically vague "java.io.IOException: Server returned HTTP response code: 500" message.
    Trouble is, I cannot get the Java System.out.prinln statements to go to the Tomcat/logs/ log files (they are all there and updating with Tomcat HttpServlet messages), in order to properly debug.
    Is there a server.xml value somewhere I can make the change?
    On another minor (possibly related) point, does anyone know what the path info ='null' means in the Tomcat access log? e.g.,
    StandardContext[/my_servlets]: Mapped to servlet 'myServlet' with servlet path '/myServlet' and path info 'null'
    It is the only other suspicious message I get in all the logs.
    One other point: my java application that fails uses threads. All the individual classes that use the threads work when run interactively, but as soon as I call them from final Serlet class that extends HttpServlet, I get a null pointer exception. Is there something unique about the Tomcat 4.1 threading that could be causing it?
    I want to avoid upgrading to Tomcat 5 at this point, if I can avoid it. My applications are modest in scope, and the last time I upgraded to Tomcat 5, it took me days to get it working properly, and I lost all access to it from the Server Admin application.

    I have found a solution: Via the Tomcat Admin web page I set the Context field "Swallow Output" to "true".

  • System.out.println logged to ?

    I am using Oracle 9ias 9.0.3 java edition.
    I have deployed a war file successfully using EM.
    i HAVE System.out.println statements in my servlets. I was unable to find any documents which tell me where these statements will be logged?
    Any one help me.

    Go to server properties page of OEM and edit OC4J options under Command Line Options. You will have to specify the OC4J option -out filename to capture the System.out messages. You can also specify the option -err filename to capture all the errors.
    check out http://technet.oracle.com/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html

  • Can not start Messaging server in Sun Java System Messaging Server 6 2005Q1

    Hi all,
    I installed Sun Java System Messaging Server 6 2005Q1 from Solaris 10 DVD on Solaris 10.
    After the installation, I got directory server, admin server running but messaging server not running. I can not start Messaging server (start smtp, http, pop, imap). I found in directory which I installed messaging server but I could not see script "start-msg" and "stop-msg".
    # pwd
    /opt/SUNWmsgsr/sbin
    # ls
    MoveUser ha_ip_config imquotacheck imsdirmig mkbackupdir
    UpgradeMsg5toMsg6.pl hashdir imsbackup imsexport readership
    configure imexpire imsconnutil imsimport reconstruct
    control-params.txt iminitquota imscripter imsrestore relinker
    deliver immonitor-access imsdaaci mboxutil useconfig
    Any idea what might have gone wrong?
    Thanks.

    Thanks.
    I have a problem when I configure the Messaging Server (by running the /opt/SUNWmsgsr/sbin/configure script):
    Hostname mailtest for this machine is not a fully qualified domain name. Please
    correct this before attempting to configure Messaging Server. Please make sure
    that your DNS is working properly.
    <Press ENTER to continue> {"<" goes back, "!" exits}
    Can you help me fix this problem?
    Thanks.

  • System.out from Java class not output to JSP

    I am using JSP to make a Java API web accessible. I include (package) java classes that write error messages to standard out when they catch an error. Works fine on the command line. Problem occurs when using in JSP. I include them with a page directive (importing the package) rather than use them as beans, since they do so much more than beans do, and since I use many of the classes in a single page.
    i.e.
    <%@ page import="OPS.*" %>
    When errors occur, messages to "standard out" (system.out) don't appear in the html output of the JSP. I don't know where they are going (they aren't in the web server's error log), but they aren't going where I expected them to (browser window).
    I figured that standard out was the browser (httpServletResponse). Where am I going wrong here?
    Basically, I have a class that connects to a database (call it db) and does queries/updates. I have a class (call it employee) that uses the db class. I have a jsp page that instantiates the employee class and executes method calls. The code in the db class that outputs SQL error messages (db class instantiated by employee class) never gets put in the browser window. Nor in the server log, nor the console.
    How can I get system.out calls in classes db and employee to get output to the browser? The JSP outputs all other code and is not freezing nor not flushing the buffer.
    Thanks!

    I also use an Iplanet over which I have little control. But I can log on via telnet. If I log on (I use Reflection) and run my pages, the errors show in the Reflection window. If you have telnet access to the server, you might want to give this a try.
    Another alternative would be to add a few lines to your classes that allow you to pass a reference to the jsp StringWriter from your jsp and use that to output the errors to the browser.

  • How to view System.out.print() messages for adapters in OIM 9.0.3

    I have created an adaptor for OIM from a java jar file. When that adaptor executes after some updates on tables it produces some execptions/error.
    I can not see the details of these exceptions as I do not know where is the standard output located when adapter is executed via OIM.
    Where cen I see output from my code lines that contain: System.out.println()?
    thanks

    I am not sure if logging is enabled as OIM was installed previously by another person - how can I check if it is enabled and how to use log4j in this case?
    OIM Design Console window shows no messages comming from my System.out.print() statements.
    /br
    Djeno

  • Sun Java System Messaging Server for Windows xp

    Hi,
    We are in a project that uses Sun Java System Messaging Server on Windows xp platform. But we didn't find the software download.
    Please tell how can i have that software?

    Messaging Server 6.x has never been released for Windows. A windows release is projected for the future, but that may be months away.
    Messaing 6.1 is available NOW for Redhat Linux AS2.1 u2 and Solaris X86. I have installed both, and find them both good.

  • Can't run java apps with System.out.println on any builder.

    Hello,
    I'm currently using Vista RC2, which is the immediate problem.
    Classes with System.out.println won't launch the console window. As I'm a student and practicing on these steps, I do have quite a problem on my hands. I click on run, build succesfull, nothing happens.
    I have tried Netbeans and Jcreator, and gave up on trying different builds, as I reckon I'll have to find some other way to counter this; any way to get println messages working in vista?

    It is run as a desktop app, and other runs with commands such as JOptionPane do function, only the println windows don't appear at all. So I think JRE is installed and working.
    I did notice there was one command for input where I'd be able to enter it at the bottom of Netbeans.
    Like just now I clicked build and run for the following code
    import java.util.*;
    public class FirstProgram
        public static void main(String[] args)
            System.out.println("Hello out there.");
            System.out.println("I will add two numbers for you.");
            System.out.println("Enter two whole numbers on a line:");
            int n1, n2;
            Scanner keyboard = new Scanner(System.in);
            n1=keyboard.nextInt();
            n2=keyboard.nextInt();
            System.out.println("The sum of those two numbers is");
            System.out.println(n1+n2)
    }Resulting in a brief flash of "input" in the output window (which is below the coding window) and it dissapears. But this also occurs when I don't include system scanner code.
    Using commands in cmd
    java -jar "C:\Users\Alegis\Netb\MyApp\dist\MyApp.jar"
    Does not yield desired results either. Nothing happens.

  • Can't resolve java.lang.System.out

    Hi,develpoers:
    Does anyone know how to fix this problem:
    C:\cai\VCTest\robo-sdk\build\sun\robot\vision\Search1.java:57: cannot resolve symbol
    symbol : variable out
    location: class java.lang.System
    System.out.println("Look returned null VisionImage");
    I don't know why this error occured because this application ran well last day.
    Thanks in advance!
    Cai

    But there is no other variable named "System". All the fields of "System" cannot be used but System.exit(1)can work. And all the methods of String like trim()can not work. Below is the codes:
    package sun.robot.vision;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import SK.gnome.twain.*;
    import sun.robot.vision.*;
    import java.lang.System;
    import java.io.*;
    public class Search1
    public Search1() {
    public void searchPuck(String colourString) {
    Image i;
    boolean found = false;
    VisionImage image = null;
    byte colour = VisionImage.NO_COLOUR;
    if (colourString.equals("red"))
    colour = VisionImage.RED;
    if (colourString.equals("blue"))
    colour = VisionImage.BLUE;
    if (colour == VisionImage.NO_COLOUR) {
    System.out.println("Invalid colour. Must be one of red or blue");
    System.exit(1);
    while (!found) {
    TwainSource source = null;
    /* grab an image from the camera */
    try {
              try{      source=TwainManager.getDefaultSource();}catch(Exception e){}
                   i=Toolkit.getDefaultToolkit().createImage(source);
              image = new VisionImage(i);          
              if (image == null) {
    System.out.println("Look returned null VisionImage");//here got the error
    System.exit(1);
    } catch (VisionException ve) {
    // System.out.println("Unable to look");
    // System.out.println(ve.getMessage());
    System.exit(1);
    image.setDebugLevel(2);
    if (image.canYouSee(colour) == false){}
    //do nothing
    else
    found = true;
    VisionObject puck = image.getVisionObject(colour);
    if (puck == null) {
    // System.out.println("Internal Error: ball is null object");
    System.exit(1);
    /* Print a message to tell the user that we've found the ball and
    * where it is relative to the robot
    StringBuffer saw = new StringBuffer("I see the ball " );
              StringBuffer size = new StringBuffer( );
    if (puck != null) {
    int pos = puck.getPosition();
    switch (pos) {
    case VisionObject.LEFT:
    saw.append("to the left of the robot");
    break;
    case VisionObject.CENTRE:
    saw.append("in front of the robot");
    break;
    case VisionObject.RIGHT:
    saw.append("to the right of the robot");
    break;
              size.append(image.getHeight()+","+image.getWidth());
    // System.out.println(size.toString());
    // System.out.println(saw.toString());
    Point c = puck.getCentre();
    mc.send(3);
    //System.exit(0);
    public static void main(String[] args) {
    if (args.length < 1) {
    //System.out.println("Usage: Fetch <ball_colour>");
    System.exit(1);
    //System.out.println("it is me");
    // String colourString = args[0].toLowerCase();
         String colourString = args[0];
         colourString= colourString.trim();//trim cannot work
    Search1 f = new Search1();
    f.searchPuck(colourString);
    Any help will be highly approciated.
    Cai

  • Problem with GlassFish and Sun Java System Message Queue

    Hi,
    I used application server PE.8 and I upgraded to Sun Java System Application Server Platform Edition 9.0 Update 1 Patch 1, and I changed all my CLASSPATH and everything. My system is working fine, but the Sun Java System Message Queue that I used before is still showing the queues and physical queues of the previous application server, not the new one. Do you know if there is way to change that and link it to the new version?
    thanks

    Use an ESB like ServiceMix to bridge JMS providers
    http://servicemix.org/
    Or write your own MessageListener to consume from one JMS and publish on another one. Be careful with queues to avoid loosing the ordering - so you probably want to use a single MessageListener per subscription/queue - or to take advantage of Tibco's exclusive queues to ensure ordering is preserved. If ordering doesn't matter then don't worry too much about it and maybe have a pool of consumers to improve throughput
    James
    http://logicblaze.com/

  • System.out.println in Web Dynpro Java

    I call System.out.println in some components in web dynpro java.  But I cannot find the standard console output file of SAP J2EE Engine. Anyone know where is the location of standard output file?

    Thanks Deepak. Your link blog is working.
    Sreeni: I cannot find a start-up log file. Could you please tell me the real path?
    Edited by: Nuttakorn Boonthamtanarung on Apr 1, 2010 6:58 AM

Maybe you are looking for