0
我正在爬行谷歌幾個小時尋找這種問題,但我找不到任何工作解決方案,我希望你們的夥伴們能夠幫助我!當JVM死亡時,Safari瀏覽器崩潰
我有一個讀取COM端口的java applet,在那個過程之後,我會殺死它,以便能夠再次讀取另一個applet,該applet在將用戶重定向到另一個頁面後被加載。
問題是,當我殺死第一個小程序,孔瀏覽器崩潰或關閉沒有任何理由...
低於我的殺手鐗功能^^
public void killMobileChecker() {
try {
System.exit(0);
} catch (Exception ex) {
if (log_level >= 4) {
ex.printStackTrace();
}
}
}
如果我不調用該函數safari不會關閉/崩潰,但下一個Java applet不能再讀取COM端口。
有沒有人有線索什麼野生動物園或可能我做錯了?
**編輯 腳本殺死所有打開的線程
private void closeConnection() {
if (portId != null && port_opened) {
try {
if (input != null) {
input.close();
}
if (output != null) {
output.close();
}
if (serialPort != null) {
serialPort.close();
}
port_opened = false;
} catch (Exception ioe) {
if (log_level >= 4) {
ioe.printStackTrace();
System.out.println("System_Error_closing_Comm_Port");
}
}
if (log_level >= 4) {
System.out.println("\r\nMobile Comm port closed\r\n");
}
// LogUtilities.writeLog("\r\nClosing Mobile Comm port...\r\n");
}
}
它聽起來像你需要正確關閉COM端口,而不是關閉整個JVM – 2010-12-09 12:23:53