我怎么能重现hs_err_pid * .log文件?

时间:2012-10-15 13:45:26

标签: java jvm-crash

我在重启HSQLDB时遇到错误 我收到热点错误日志。
我想在本地机器上重现该错误 任何人都可以帮我重现hs_err_pid * .log文件吗?
如果是这样,那么步骤是什么?

1 个答案:

答案 0 :(得分:0)

使用哪个JRE编译下面的代码无关紧要,如果在JRE1.7下运行它,你将收到错误。

代码:

import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
public class TestFileChooser{
    public static void main(String[] args){ 
        try{
            //If you comment the code below, no error will occur
            DriverManager.getConnection(
            "jdbc:hsqldb:file:C:/DB_Test/DB_Test", 
            "userAdmin", "pass");
        }catch(SQLException e){
            JOptionPane.showMessageDialog(null,e.getMessage());
        }   
        JFileChooser chooser = new JFileChooser("C:");  
        chooser.showOpenDialog(null);   
        System.exit(0);
    }
}

测试(重现错误):

  1. 使用JRE1.7
  2. 编译并运行以下代码
  3. 它会打开一个JFileChooser
  4. 单击按钮以列出文件的详细信息(位于右上角)
  5. 它将显示文件及其详细信息的表格
  6. 点击表格标题
  7. 程序将突然退出并创建文件hs_err_pid
相关问题