JavaFX应用程序中应用程序启动方法中的异常
乍一看,这个问题似乎是重复的。我在谷歌上做了一些搜索,但不幸的是没有一个搜索结果与我不匹配。我已经给出了下面的问题链接 好的,让我们来谈谈我的问题。我使用Netbeans和Spring进行依赖注入。我的代码运行良好。我刚刚添加了一个新方法,并用一个按钮将其连接起来。按下运行按钮后,我得到了错误信息 堆栈跟踪:JavaFX应用程序中应用程序启动方法中的异常,java,spring,exception,javafx,dependency-injection,Java,Spring,Exception,Javafx,Dependency Injection,乍一看,这个问题似乎是重复的。我在谷歌上做了一些搜索,但不幸的是没有一个搜索结果与我不匹配。我已经给出了下面的问题链接 好的,让我们来谈谈我的问题。我使用Netbeans和Spring进行依赖注入。我的代码运行良好。我刚刚添加了一个新方法,并用一个按钮将其连接起来。按下运行按钮后,我得到了错误信息 堆栈跟踪: Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@Override
public void start(Stage stage) throws Exception
{
System.out.println("Start1...........");
try
{
Parent root = FXMLLoader.load(getClass().getResource("FXML_Main.fxml"));
System.out.println("Start2...........");
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@FXML
private void other_save_new_and_save_edit_other_word_button_action(ActionEvent actionEvent)
{
bean_controller_Other_I.other_save_new_and_save_edit_other_word_button_action(actionEvent);
}
<Button layoutX="197.0" layoutY="32.0" mnemonicParsing="false" onAction="#other_save_new_and_save_edit_other_word_button_action" prefWidth="75.0" text="Save" AnchorPane.leftAnchor="197.0" />
public class ApplicationContextSingleTon
{
private static ApplicationContext applicationContext ;
public static ApplicationContext getBean()
{
System.out.println(" AC_Line 1 : ");
if(applicationContext == null)
{
System.out.println(" AC_Line 2 : ");
applicationContext = new ClassPathXmlApplicationContext("vocubularyBean.xml");
System.out.println(" AC_Line 3 : ");
}
return applicationContext;
}
}
public interface ApplicationContext_I
{
ApplicationContext applicationContext = ApplicationContextSingleTon.getBean();
}
从这个堆栈跟踪中,我无法跟踪错误。然后我使用了Try-Catch-within-start方法,但没有确切的错误消息
启动方法:
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@Override
public void start(Stage stage) throws Exception
{
System.out.println("Start1...........");
try
{
Parent root = FXMLLoader.load(getClass().getResource("FXML_Main.fxml"));
System.out.println("Start2...........");
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@FXML
private void other_save_new_and_save_edit_other_word_button_action(ActionEvent actionEvent)
{
bean_controller_Other_I.other_save_new_and_save_edit_other_word_button_action(actionEvent);
}
<Button layoutX="197.0" layoutY="32.0" mnemonicParsing="false" onAction="#other_save_new_and_save_edit_other_word_button_action" prefWidth="75.0" text="Save" AnchorPane.leftAnchor="197.0" />
public class ApplicationContextSingleTon
{
private static ApplicationContext applicationContext ;
public static ApplicationContext getBean()
{
System.out.println(" AC_Line 1 : ");
if(applicationContext == null)
{
System.out.println(" AC_Line 2 : ");
applicationContext = new ClassPathXmlApplicationContext("vocubularyBean.xml");
System.out.println(" AC_Line 3 : ");
}
return applicationContext;
}
}
public interface ApplicationContext_I
{
ApplicationContext applicationContext = ApplicationContextSingleTon.getBean();
}
在开始方法中添加Try-Catch后的堆栈跟踪:
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@Override
public void start(Stage stage) throws Exception
{
System.out.println("Start1...........");
try
{
Parent root = FXMLLoader.load(getClass().getResource("FXML_Main.fxml"));
System.out.println("Start2...........");
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@FXML
private void other_save_new_and_save_edit_other_word_button_action(ActionEvent actionEvent)
{
bean_controller_Other_I.other_save_new_and_save_edit_other_word_button_action(actionEvent);
}
<Button layoutX="197.0" layoutY="32.0" mnemonicParsing="false" onAction="#other_save_new_and_save_edit_other_word_button_action" prefWidth="75.0" text="Save" AnchorPane.leftAnchor="197.0" />
public class ApplicationContextSingleTon
{
private static ApplicationContext applicationContext ;
public static ApplicationContext getBean()
{
System.out.println(" AC_Line 1 : ");
if(applicationContext == null)
{
System.out.println(" AC_Line 2 : ");
applicationContext = new ClassPathXmlApplicationContext("vocubularyBean.xml");
System.out.println(" AC_Line 3 : ");
}
return applicationContext;
}
}
public interface ApplicationContext_I
{
ApplicationContext applicationContext = ApplicationContextSingleTon.getBean();
}
从这个堆栈跟踪中,我认为FXML文件中可能存在一些问题,因为第二行尚未打印。但我的问题是为什么它没有显示任何错误消息?我正在使用SceneBuilder。
我创建了一个空的FXML文件,它正在加载
控制器代码片段:
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@Override
public void start(Stage stage) throws Exception
{
System.out.println("Start1...........");
try
{
Parent root = FXMLLoader.load(getClass().getResource("FXML_Main.fxml"));
System.out.println("Start2...........");
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@FXML
private void other_save_new_and_save_edit_other_word_button_action(ActionEvent actionEvent)
{
bean_controller_Other_I.other_save_new_and_save_edit_other_word_button_action(actionEvent);
}
<Button layoutX="197.0" layoutY="32.0" mnemonicParsing="false" onAction="#other_save_new_and_save_edit_other_word_button_action" prefWidth="75.0" text="Save" AnchorPane.leftAnchor="197.0" />
public class ApplicationContextSingleTon
{
private static ApplicationContext applicationContext ;
public static ApplicationContext getBean()
{
System.out.println(" AC_Line 1 : ");
if(applicationContext == null)
{
System.out.println(" AC_Line 2 : ");
applicationContext = new ClassPathXmlApplicationContext("vocubularyBean.xml");
System.out.println(" AC_Line 3 : ");
}
return applicationContext;
}
}
public interface ApplicationContext_I
{
ApplicationContext applicationContext = ApplicationContextSingleTon.getBean();
}
FXML代码片段:
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@Override
public void start(Stage stage) throws Exception
{
System.out.println("Start1...........");
try
{
Parent root = FXMLLoader.load(getClass().getResource("FXML_Main.fxml"));
System.out.println("Start2...........");
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@FXML
private void other_save_new_and_save_edit_other_word_button_action(ActionEvent actionEvent)
{
bean_controller_Other_I.other_save_new_and_save_edit_other_word_button_action(actionEvent);
}
<Button layoutX="197.0" layoutY="32.0" mnemonicParsing="false" onAction="#other_save_new_and_save_edit_other_word_button_action" prefWidth="75.0" text="Save" AnchorPane.leftAnchor="197.0" />
public class ApplicationContextSingleTon
{
private static ApplicationContext applicationContext ;
public static ApplicationContext getBean()
{
System.out.println(" AC_Line 1 : ");
if(applicationContext == null)
{
System.out.println(" AC_Line 2 : ");
applicationContext = new ClassPathXmlApplicationContext("vocubularyBean.xml");
System.out.println(" AC_Line 3 : ");
}
return applicationContext;
}
}
public interface ApplicationContext_I
{
ApplicationContext applicationContext = ApplicationContextSingleTon.getBean();
}
我认为没有必要描述代码,因为它们是自解释的。我已经确定一些xml代码是xml映射文件中的问题。我想我终于找到了问题所在
如果我在xml映射文件的问题区域内保持代码活动,那么问题就发生了。但是如果我评论这些台词,那么这个节目开始得很好
另一个问题是,如果这些行处于活动状态,则在ApplicationContextSingleTon类中,“AC_行3”不会被打印。表示应用程序正在“AC_第2行”停止
我想我已经正确地映射了这些类。当我使用Netbeans时,如果我在问题区域中映射的类名上执行ctrl+clik,Netbeans将带我去类
现在我有两个问题:
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@Override
public void start(Stage stage) throws Exception
{
System.out.println("Start1...........");
try
{
Parent root = FXMLLoader.load(getClass().getResource("FXML_Main.fxml"));
System.out.println("Start2...........");
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Executing C:\Users\Dell-3460\Documents\NetBeansProjects\JavaFXApplication_Vocubulary_Own\dist\run151098339\JavaFXApplication_Vocubulary_Own.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
Start1...........
Nov 23, 2017 10:30:52 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.141 by JavaFX runtime of version 8.0.102
Nov 23, 2017 10:30:53 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d4f4e8e: startup date [Thu Nov 23 22:30:53 BDT 2017]; root of context hierarchy
Nov 23, 2017 10:30:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [vocubularyBean.xml]
Exception in Application start method
@FXML
private void other_save_new_and_save_edit_other_word_button_action(ActionEvent actionEvent)
{
bean_controller_Other_I.other_save_new_and_save_edit_other_word_button_action(actionEvent);
}
<Button layoutX="197.0" layoutY="32.0" mnemonicParsing="false" onAction="#other_save_new_and_save_edit_other_word_button_action" prefWidth="75.0" text="Save" AnchorPane.leftAnchor="197.0" />
public class ApplicationContextSingleTon
{
private static ApplicationContext applicationContext ;
public static ApplicationContext getBean()
{
System.out.println(" AC_Line 1 : ");
if(applicationContext == null)
{
System.out.println(" AC_Line 2 : ");
applicationContext = new ClassPathXmlApplicationContext("vocubularyBean.xml");
System.out.println(" AC_Line 3 : ");
}
return applicationContext;
}
}
public interface ApplicationContext_I
{
ApplicationContext applicationContext = ApplicationContextSingleTon.getBean();
}
我几乎没有遇到这个问题,也不明白为什么没有打印异常。和你一样,我也试着用try-catch来环绕我的整个启动方法。 结果证明STDERR没有被发送到正确的位置。我发现这一点的方法是(再次)尝试捕获,并使用
System.out.println(ex)
而不是ex.printStackTrace()
。您还可以使用ex.printStackTrace(System.out)
我想我参加聚会迟到了,但希望我能帮助任何可能遇到同样问题的人。我几乎没有遇到这个问题,也不明白为什么没有打印例外。和你一样,我也试着用try-catch来环绕我的整个启动方法。 结果证明STDERR没有被发送到正确的位置。我发现这一点的方法是(再次)尝试捕获,并使用
System.out.println(ex)
而不是ex.printStackTrace()
。您还可以使用ex.printStackTrace(System.out)
我想我参加聚会迟到了,但希望我能帮助任何可能遇到同样问题的人。我最近遇到了打印“启动方法中的异常”,但没有打印堆栈跟踪的问题。捕获异常的解决方案(至少对我来说)是捕获可丢弃的
而不是异常
。例如:
@Override
public void start(Stage stage) throws Exception {
try {
//... start method code here
} catch(Throwable t) {
t.printStackTrace()
}
}
我最近遇到了打印“启动方法中的异常”但没有打印堆栈跟踪的问题。捕获异常的解决方案(至少对我来说)是捕获可丢弃的而不是异常
。例如:
@Override
public void start(Stage stage) throws Exception {
try {
//... start method code here
} catch(Throwable t) {
t.printStackTrace()
}
}
如何初始化SpringDI??将CDI挂接到FXMLLoader的位置???这可能不是解决方案,但最好将其排除在外。。。有可能满足JavaFXAPI版本警告中提到的条件吗?@Rafael Guillen,对不起,我不熟悉CDI。我在重写的“initialize”方法中使用bean by application context。当我说CDI时,我指的是Spring DI,您如何将Spring框架集成到JavaFx?出于某种原因,它可能是您所看到的全部,但它不是完整的堆栈跟踪。为了诊断问题,您需要弄清楚如何获取完整的堆栈跟踪。您是否真的到达了catch
块?如果是这样的话,您真的应该从代码中看到剩余的堆栈跟踪??将CDI挂接到FXMLLoader的位置???这可能不是解决方案,但最好将其排除在外。。。有可能满足JavaFXAPI版本警告中提到的条件吗?@Rafael Guillen,对不起,我不熟悉CDI。我在重写的“initialize”方法中使用bean by application context。当我说CDI时,我指的是Spring DI,您如何将Spring框架集成到JavaFx?出于某种原因,它可能是您所看到的全部,但它不是完整的堆栈跟踪。为了诊断问题,您需要弄清楚如何获取完整的堆栈跟踪。您是否真的到达了catch
块?如果是这样,您真的应该从代码中看到剩余的堆栈跟踪。欢迎使用堆栈溢出。只需确保您捕获Throwable的原因是正确的:[()欢迎来到Stack Overflow。只需确保您捕获Throwable的原因是正确的:[()