RoyalSloth / SlothTracker

Cross Platform Time Tracking Software
https://www.royalsloth.eu
0 stars 0 forks source link

Crash on OpenJDK 11 #4

Open adderthorn opened 3 years ago

adderthorn commented 3 years ago

Using Windows 10 20H2 (19042.928) and OpenJDK 11

openjdk version "11.0.9.1" 2020-11-04 LTS
OpenJDK Runtime Environment Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS, mixed mode)

I get a crash on SlothTracker startup with the following:

java.lang.NullPointerException
    at com.royalsloth.timetracker.RSSystemTray.addIconToTray(RSSystemTray.java:120)
    at com.royalsloth.timetracker.MainApp.createMainScreenConnections(MainApp.java:254)
    at com.royalsloth.timetracker.MainApp$1.call(MainApp.java:101)
    at com.royalsloth.timetracker.MainApp$1.call(MainApp.java:97)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.lang.Thread.run(Thread.java:829)
RoyalSloth commented 3 years ago

I've tested this on the latest Windows 10 20H2 patch (2004) and I can't reproduce this problem. If this exception is making the application unusable, the quickest workaround that you can try (until this problem is fixed) is to manually change the configuration.yaml file in C://users/<user>/AppData/Roaming/RoyalSloth/SlothTracker and set the putAppIntoTray field to false. Unfortunately the application will not be using tray after this change.

Example configuration.yaml:

---
General:
  stopTrackingTimeOnExit: true
  putAppIntoTray: false
  maxTimeOverlapForAutomaticResolution: 10
  copyTaskDescriptionOnTaskDoubleClick: false
  mainWindowTimeFormat: "hh:mm"
  defaultDurationFormat: "hh:mm (min)"
  workingDayStartsAt: "08:00"
adderthorn commented 3 years ago

I will try this out. Could you test to see if perhaps it is related to that version of Coretto build of OpenJDK? I am required to use this version for other software I run.

RoyalSloth commented 3 years ago

I've just tried running it with the same Correto version (11.0.9.12.1) and it runs the application with the tray just fine. This problem looks like a bug in the library which we are using for displaying the tray (and apparently it only shows up on a specific Windows version)

adderthorn commented 3 years ago

In the meantime, changing the YAML config seems to prevent the crash. However, I'd like to see this work in the future. Perhaps the library will have a updated version sometime that may resolve the issue?