PikaTimer / pikatimer

PikaTimer: An OpenSource race timing application
GNU General Public License v3.0
37 stars 16 forks source link

java.lang.IllegalStateException: Task must only be used from the FX Application Thread #23

Closed morozen closed 6 years ago

morozen commented 6 years ago

Hello,

could you please help me to understand, what might be wrong with my current setup. Piketimer is bailing out with the following error:

OOPS! jar:file:/Users/imorozov/Downloads/PikaTimer-1.5.jar/Pikatimer.jar!/com/pikatimer/FXMLpika.fxml
javafx.fxml.LoadException:
file:/Users/imorozov/Downloads/PikaTimer-1.5.jar/Pikatimer.jar!/com/pikatimer/results/FXMLResults.fxml
file:/Users/imorozov/Downloads/PikaTimer-1.5.jar/Pikatimer.jar!/com/pikatimer/FXMLpika.fxml:89

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2571)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    at javafx.fxml.FXMLLoader.access$2700(FXMLLoader.java:103)
    at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1143)
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:746)
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
    at com.pikatimer.FXMLopenEventController$1.call(FXMLopenEventController.java:195)
    at com.pikatimer.FXMLopenEventController$1.call(FXMLopenEventController.java:115)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566)
    ... 13 more
Caused by: java.lang.IllegalStateException: Task must only be used from the FX Application Thread
    at javafx.concurrent.Task.checkThread(Task.java:1218)
    at javafx.concurrent.Task.progressProperty(Task.java:981)
    at com.pikatimer.results.FXMLResultsController.initializeAutoUpdate(FXMLResultsController.java:889)
    at com.pikatimer.results.FXMLResultsController.initialize(FXMLResultsController.java:187)
    ... 23 more

java version:

[imorozov@1060-imorozov PikaTimer-1.5.jar ]$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

command line:

java -Xmx6g -jar Pikatimer.jar
segfaultcoredump commented 6 years ago

Odd. It is blowing up on the following line in the results controller: autoUpdateProgressBar.progressProperty().bind(autoUpdateTask.progressProperty()); But the kicker is that has to be on the FX Application thread since the stuff just above the Task creation is also on the app thread.

I have seen this before in FX bugs. Try JDK 1.8.0_171 (which I still have) to see if the issue persists.