Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Auto shutdown OS on SPARC T4-2

2742611Oct 18 2017 — edited Oct 23 2017

I have a issue about SPARC T4-2, it usually shutdown OS about 2-3 day, and i checked log only appear " SC Alert: [ID 817872 daemon.error] System | major: System shutdown has been requested"

Please help me check it.

Comments

843806
Add a JTextArea to your frame, create a TextAreaOutputStream with it, and use System.setOut(...) to set System.ouot
/*
 * Created on Mar 13, 2005 by @author Tom Jacobs
 *
 */
package tjacobs;

import java.io.IOException;
import java.io.OutputStream;

import javax.swing.JTextArea;
import javax.swing.text.JTextComponent;

/**
 * TextAreaOutputStream creates an outputstream that will output to the
 * given textarea. Useful in setting System.out
 */
public class TextAreaOutputStream extends OutputStream {
	public static final int DEFAULT_BUFFER_SIZE = 1;
	
	JTextArea mText;
	byte mBuf[];
	int mLocation;
	public TextAreaOutputStream(JTextArea component) {
		this(component, DEFAULT_BUFFER_SIZE);
	}

	public TextAreaOutputStream(JTextArea component, int bufferSize) {
		mText = component;
		if (bufferSize < 1) bufferSize = 1;
		mBuf = new byte[bufferSize];
		mLocation = 0;
	}
	@Override
	public void write(int arg0) throws IOException {
		//System.err.println("arg = "  + (char) arg0);
		mBuf[mLocation++] = (byte)arg0;
		if (mLocation == mBuf.length) {
			flush();
		}
	}
	
	public void flush() {
		mText.append(new String(mBuf, 0, mLocation));
		mLocation = 0;
/*
		try {
			Thread.sleep(1);
		}
		catch (Exception ex) {}
	}
	*/
	}
}
843806
Thanks for the sample, it's very useful :)
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 20 2017
Added on Oct 18 2017
5 comments
433 views