Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal state exception after switching into the "file annotations" tab #8669

Closed
2 tasks done
ThiloteE opened this issue Apr 12, 2022 · 2 comments
Closed
2 tasks done
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files

Comments

@ThiloteE
Copy link
Member

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

JabRef 5.6--2022-04-11--1c782b7 Windows 10 10.0 amd64 Java 17.0.2 JavaFX 18+12

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Have an entry with a linked pdf file
  2. Have no annotation within this pdf file
  3. Switch into the `file annotations" tab

The exception does NOT emerge everytime.

Appendix

...

Log File
java.lang.IllegalStateException: Cannot load org.jabref.gui.entryeditor.fileannotationtab.fileannotationtab
	at org.jabref.merged.module@5.6.160/com.airhacks.afterburner.views.ViewLoader.load(Unknown Source)
	at org.jabref@5.6.160/org.jabref.gui.entryeditor.fileannotationtab.FileAnnotationTab.bindToEntry(Unknown Source)
	at org.jabref@5.6.160/org.jabref.gui.entryeditor.EntryEditorTab.notifyAboutFocus(Unknown Source)
	at org.jabref@5.6.160/org.jabref.gui.entryeditor.EntryEditor.lambda$new$0(Unknown Source)
	at com.tobiasdiez.easybind@2.2/com.tobiasdiez.easybind.EasyBind.lambda$subscribe$1(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.control.SelectionModel.setSelectedItem(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.control.TabPane$TabPaneSelectionModel.select(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.control.TabPane$TabPaneSelectionModel.select(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.control.TabPane$TabPaneSelectionModel.select(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.scene.control.behavior.TabPaneBehavior.selectTab(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.control.skin.TabPaneSkin$TabHeaderSkin$5.handle(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.control.skin.TabPaneSkin$TabHeaderSkin$5.handle(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.event.Event.fireEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.Scene$MouseHandler.process(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.Scene.processMouseEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.glass.ui.View.notifyMouse(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at org.jabref.merged.module@5.6.160/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javafx.fxml.LoadException: 
/org.jabref/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTab.fxml

	at org.jabref.merged.module@5.6.160/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
	at org.jabref.merged.module@5.6.160/javafx.fxml.FXMLLoader.load(Unknown Source)
	... 61 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
	at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
	... 64 more
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: 1-based index not found: 1
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache$Segment.get(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache.get(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache.getOrLoad(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache$LocalLoadingCache.get(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(Unknown Source)
	at org.jabref@5.6.160/org.jabref.logic.pdf.FileAnnotationCache.getFromCache(Unknown Source)
	at org.jabref@5.6.160/org.jabref.gui.entryeditor.fileannotationtab.FileAnnotationTabViewModel.<init>(Unknown Source)
	at org.jabref@5.6.160/org.jabref.gui.entryeditor.fileannotationtab.FileAnnotationTabView.initialize(Unknown Source)
	... 74 more
Caused by: java.lang.IllegalStateException: 1-based index not found: 1
	at org.jabref.merged.module@5.6.160/org.apache.pdfbox.pdmodel.PDPageTree.get(Unknown Source)
	at org.jabref.merged.module@5.6.160/org.apache.pdfbox.pdmodel.PDPageTree.get(Unknown Source)
	at org.jabref@5.6.160/org.jabref.logic.pdf.PdfAnnotationImporter.importAnnotations(Unknown Source)
	at org.jabref@5.6.160/org.jabref.logic.pdf.EntryAnnotationImporter.lambda$importAnnotationsFromFiles$2(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.jabref@5.6.160/org.jabref.logic.pdf.EntryAnnotationImporter.importAnnotationsFromFiles(Unknown Source)
	at org.jabref@5.6.160/org.jabref.logic.pdf.FileAnnotationCache$1.load(Unknown Source)
	at org.jabref@5.6.160/org.jabref.logic.pdf.FileAnnotationCache$1.load(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache$Segment.loadSync(Unknown Source)
	at org.jabref.merged.module@5.6.160/com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(Unknown Source)
	... 82 more

@ThiloteE
Copy link
Member Author

(I have NOT written any XMP metadata to the file).

@ThiloteE ThiloteE added bug Confirmed bugs or reports that are very likely to be bugs external files labels Apr 12, 2022
@ThiloteE
Copy link
Member Author

Found out the pdf files that trigger this error were the ones that had become corrupted by using the development versions of Jabref to write XMP metadata during the period from ~ 2022-02-21 to 2022-04-11. Apparently I still had some corrupt pdf files I had forgotten about. Overall fix seems to be #8658.

Will close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files
Projects
None yet
Development

No branches or pull requests

1 participant