开发者

Safari is crashing when JVM get killed

开发者 https://www.devze.com 2023-01-29 10:25 出处:网络
i was crawling google couple of hours to search for that kind of problem but i could not find any working solution, i hope your guys can help me out!

i was crawling google couple of hours to search for that kind of problem but i could not find any working solution, i hope your guys can help me out!

i have a java applet which read the COM ports, after that process i gonna kill it to be able to read it again with another applet which gets loaded after i redirect the user to another page.

The problem is when i kill the first applet, the hole browser crashes or is closing for no reason...

below my killer function ^^

public void killMobileChecker() {
        try {
            System.exit(0);
        } catch (Exception ex) {
            if (log_level >= 4) {
                ex.printStackTrace();
            }
        }
    }

if i dont call that function safari will not close/crash but the next java applet is not able anymore to read the COM port.

Does anybody have a clue what safari or likely me is doing wrong?

** Edit script to kill all open threads

    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开发者_JS百科.println("\r\nMobile Comm port closed\r\n");
            }
//                LogUtilities.writeLog("\r\nClosing Mobile Comm port...\r\n");
        }
    }


Which JVM version are you using? After jdk1.6 update 10 the applet should utilize a separate process from the browser. Before that time browser and applet shared the same process.

0

精彩评论

暂无评论...
验证码 换一张
取 消