Debugging JavaFX应用程序随机崩溃

Debugging JavaFX应用程序随机崩溃,debugging,crash,javafx,javafx-2,Debugging,Crash,Javafx,Javafx 2,我对编程相当陌生,已经用JavaFX为我和一些朋友编写了一个应用程序(总是在Windows7或8Java7U25+上运行)。它通常工作正常,但在随机情况下,JVM只是崩溃(不幸的是无法复制)。控制台打印以下内容(它总是一个大的负数,但从不相同) Java结果:-140589632 这本书有几千行,由于我真的不知道如何面对这个问题,也没有人真正想读这本书,我不知何故不知该怎么办。很抱歉没有说得很具体,我只是不知道如何提供更多有用的信息 如果有任何帮助,我都会很高兴。请让我也知道我可以提供什么信息来

我对编程相当陌生,已经用JavaFX为我和一些朋友编写了一个应用程序(总是在Windows7或8Java7U25+上运行)。它通常工作正常,但在随机情况下,JVM只是崩溃(不幸的是无法复制)。控制台打印以下内容(它总是一个大的负数,但从不相同)

Java结果:-140589632

这本书有几千行,由于我真的不知道如何面对这个问题,也没有人真正想读这本书,我不知何故不知该怎么办。很抱歉没有说得很具体,我只是不知道如何提供更多有用的信息

如果有任何帮助,我都会很高兴。请让我也知道我可以提供什么信息来帮助解决这个案件。目前,我正在寻求关于如何解决这些问题的一般性建议。 谢谢大家!

更新1: 我正在使用libs h2-1.3.173.jar和pircbotx-1.9.jar 以下是大多数类和导入的列表(很抱歉,有两个):

控制器类:

import java.io.IOException;
import java.net.URL;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.TextField;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.Slider;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.media.MediaPlayer.Status;
import javafx.scene.text.Text;
import javafx.util.Callback;
import org.pircbotx.User;
import java.util.prefs.Preferences;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.media.MediaPlayer;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import org.pircbotx.exception.IrcException;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaPlayer.Status;
import javafx.util.Duration;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import javafx.application.Platform;
import javafx.scene.paint.Color;
MediaPlayer控制器类:

import java.io.IOException;
import java.net.URL;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.TextField;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.Slider;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.media.MediaPlayer.Status;
import javafx.scene.text.Text;
import javafx.util.Callback;
import org.pircbotx.User;
import java.util.prefs.Preferences;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.media.MediaPlayer;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import org.pircbotx.exception.IrcException;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaPlayer.Status;
import javafx.util.Duration;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import javafx.application.Platform;
import javafx.scene.paint.Color;
“开始”课程:

ircBot的侦听器类:

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javafx.application.Platform;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaPlayer.Status;
import javafx.scene.paint.Color;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.events.ConnectEvent;
import org.pircbotx.hooks.events.DisconnectEvent;
import org.pircbotx.hooks.events.JoinEvent;
import org.pircbotx.hooks.events.KickEvent;
import org.pircbotx.hooks.events.MessageEvent;
import org.pircbotx.hooks.events.NickChangeEvent;
import org.pircbotx.hooks.events.PartEvent;
import org.pircbotx.hooks.events.QuitEvent;
import org.pircbotx.hooks.events.UserListEvent;
用于在设置的时间间隔上检查ircbot连接状态的Runnable/daemon线程:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;
数据库管理类:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.Collator;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

如果你想要我,我可以把整个源代码上传到某个地方。可能具有娱乐潜力:)

如果看不到代码,这将很棘手。你能把范围缩小到(类级或包级)吗?也许可以尝试获取JVMI的日志对不起,但是我在哪里可以找到这个日志,或者如何让JVM创建一个日志?你有没有尝试在所有线程中捕获Throwable?在某些地方可能会有一个实际的例外,它会被吞下并导致不稳定……谢谢,我承认有些部分不会被试捕弄得一团糟,因为我真诚地认为不会出什么差错。我要试试看