Random "uncaught error" appears in JabRef 5.9

Dear JabRef community,

I like to use JabRef for organizing my citations. I have a number of files and many citations. Currently, I am working on one main file with more than 650 entries. Editing it has worked pretty well the past weeks, but recently I opened a second file for some other project and kept both open in parallel.

Lately, I have been going back to the first file where I now experience random errors that pop up and interrupt the editing process. It’s suuuper annoying, and I don’t see any obvious indication for the error. The error message reads something like this:

Uncaught exception occurred in Thread[#78.pool-6-thread-1,5,main]

The entire error log looks like this:

java.lang.IllegalStateException: This operation is permitted on the event thread only; currentThread = pool-6-thread-1
	at org.jabref.merged.module@5.9.6000/com.sun.glass.ui.Application.checkEventThread(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.glass.ui.View.getNativeView(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.glass.ui.win.WinAccessible.get_HostRawElementProvider(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.glass.ui.win.WinAccessible.UiaRaiseAutomationPropertyChangedEvent(Native Method)
	at org.jabref.merged.module@5.9.6000/com.sun.glass.ui.win.WinAccessible.sendNotification(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.Node.notifyAccessibleAttributeChanged(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl$TextProperty.controlContentHasChanged(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl.lambda$new$0(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextArea$TextAreaContent.insert(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl.replaceText(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl.filterAndSet(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl$TextProperty.doSet(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.BidirectionalBinding$TypedGenericBidirectionalBinding.invalidated(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringPropertyBase.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringPropertyBase.markInvalid(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringPropertyBase.set(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringPropertyBase.set(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.gui.util.BindingsHelper$BidirectionalBinding.updateLocked(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.gui.util.BindingsHelper$BidirectionalBinding.changedB(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/javafx.beans.binding.ObjectBinding.invalidate(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.binding.BindingHelperObserver.invalidated(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.collections.MapListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.collections.ObservableMapWrapper.callObservers(Unknown Source)
	at org.jabref.merged.module@5.9.6000/com.sun.javafx.collections.ObservableMapWrapper.put(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.model.entry.BibEntry.setField(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.cleanup.FieldFormatterCleanup.cleanupSingleField(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.cleanup.FieldFormatterCleanup.cleanupAllFields(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.cleanup.FieldFormatterCleanup.cleanup(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.exporter.BibDatabaseWriter.applySaveActions(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.autosaveandbackup.BackupManager.performBackup(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.jabref@5.9.6000/org.jabref.logic.autosaveandbackup.BackupManager.lambda$startBackupTask$4(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

I am using this JabRef version:

JabRef 5.9--2023-01-08--76253f1a7
Windows 11 10.0 amd64 
Java 19.0.1 
JavaFX 19+11

Googling for this, I found a discussion from 2020 (Uncaught Exception occurred in Thread · Issue #6921 · JabRef/jabref · GitHub) where it is suggested that it has to do with the autosave function that one should turn off in order to fix it. But this is already turned off in my setup.

I suspect that the error is generated by some routine in the background, which by itself is annoying because it makes the cursor jump to the beginning of the entry WHILE I AM EDITING IT. So I have to place it back to the location where it was to continue editing. Well, this behavior has disappeared but instead the error has appeared, and it occurs in very similar situations to when the cursor has jumped in the past weeks.

Does anybody have a suggestion on how to fix this? I’d prefer neither error nor annoying cursor jumps :slight_smile:

Thank you!
heico

Hi,

Thanks for the report. Can you please try the latest development version? We did a couple of fixes related to saving and autosaving index - powered by h5ai v0.29.0 (https://larsjung.de/h5ai/)
Remember to make a backup of your library before you try out the new version

Hi Christoph!

I’ve edited a couple of references and on first sight it seems to work smoothly with the development version.

Thanks so much!
heico

1 Like

Hi Christoph!

I continued editing today and the errors reappeared, now using the development version 5.10 that you gave me. The error log reads:

java.lang.IllegalStateException: This operation is permitted on the event thread only; currentThread = pool-5-thread-1
	at org.jabref.merged.module@5.10.403/com.sun.glass.ui.Application.checkEventThread(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.glass.ui.View.getNativeView(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.glass.ui.win.WinAccessible.get_HostRawElementProvider(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.glass.ui.win.WinAccessible.UiaRaiseAutomationPropertyChangedEvent(Native Method)
	at org.jabref.merged.module@5.10.403/com.sun.glass.ui.win.WinAccessible.sendNotification(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.Node.notifyAccessibleAttributeChanged(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl$TextProperty.controlContentHasChanged(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl.lambda$new$0(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextArea$TextAreaContent.insert(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl.replaceText(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl.filterAndSet(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl$TextProperty.doSet(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.BidirectionalBinding$TypedGenericBidirectionalBinding.invalidated(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringPropertyBase.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringPropertyBase.markInvalid(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringPropertyBase.set(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringPropertyBase.set(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref@5.10.403/org.jabref.gui.util.BindingsHelper$BidirectionalBinding.updateLocked(Unknown Source)
	at org.jabref@5.10.403/org.jabref.gui.util.BindingsHelper$BidirectionalBinding.changedB(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/javafx.beans.binding.ObjectBinding.invalidate(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.binding.BindingHelperObserver.invalidated(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.collections.MapListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.collections.ObservableMapWrapper.callObservers(Unknown Source)
	at org.jabref.merged.module@5.10.403/com.sun.javafx.collections.ObservableMapWrapper.put(Unknown Source)
	at org.jabref@5.10.403/org.jabref.model.entry.BibEntry.setField(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.cleanup.FieldFormatterCleanup.cleanupSingleField(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.cleanup.FieldFormatterCleanup.cleanupAllFields(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.cleanup.FieldFormatterCleanup.cleanup(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.exporter.BibDatabaseWriter.applySaveActions(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.autosaveandbackup.BackupManager.performBackup(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.jabref@5.10.403/org.jabref.logic.autosaveandbackup.BackupManager.lambda$startBackupTask$4(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

And just for completeness, this is the version:

JabRef 5.10--2023-04-03--8437a70
Windows 11 10.0 amd64 
Java 19.0.2 
JavaFX 20+19

I also tried with 5.9 again. For 5.9 the errors seem to appear more often than for 5.10. For the latter they appear like once during the editing of an entry, for the former 2-3 times per entry.

Thank you!
heico

Thanks, it seems like it has something to do with the cleanup save actions that are executed and trigger the exception. Can you please tell me which save actions you have configured?
(Library → Saving → Field formatters)

Hi Christoph,

thanks for replying on Good Friday!

I do not have field formatters enabled.

Regards, heico

Hello Everyone

I’m looking for a solution for this issue, In my case the error is generated when I´m adding mor data to some entries on a scopus-generated file.
While the developpers solve it, you should use the BibTeX source of the entry that is triggering the message, in order to complete the data that you want to add.

It works for me…

Have a great research!

@orwandil, if you believe this error is caused by special characters or erroneous syntax in your library file, I would kindly ask you to read Debugging your library file - JabRef and try to cut down to a minimal non-working example. This would help maintainers a lot and speed up any potential fix.