jabref icon indicating copy to clipboard operation
jabref copied to clipboard

dragging files and folders on entry generates exception

Open ilippert opened this issue 4 years ago • 23 comments

JabRef 5.2--2020-11-03--b5bcea4 Linux 5.8.17-200.fc32.x86_64 amd64 Java 15.0.1

Upon dragging a pdf (without write file permissions) on an entry, I got this exception.

Log File
java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Nov 04 '20 10:11 ilippert

JabRef 5.2--2020-11-05--09f8098 Linux 5.8.18-200.fc32.x86_64 amd64 Java 15.0.1

another log case for the same error - but without read-only file.

Log File

java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Nov 07 '20 13:11 ilippert

Exception, but file was attached.

Log File

java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Nov 08 '20 03:11 ilippert

Same happens regularly (error, but file gets attached) - just documenting the errors, in case that is helpful.

JabRef 5.2--2020-11-17--a335f0d Linux 5.9.8-200.fc33.x86_64 amd64 Java 15.0.1

Log File

java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Nov 18 '20 08:11 ilippert

It's always the same error, so no need to report it everytime, but I fear it's somehow related to javafx. I am not sure if we can do anything about this atm. Coul you please give some more information about your GUI toolkit? KDE? GTK? Gnome? There was a similar thing in OSX which got fixed in the latest javafx application.

Siedlerchr avatar Nov 18 '20 08:11 Siedlerchr

Ok, thanks a lot. This is gnome, Fedora 33, Wayland.

ilippert avatar Nov 18 '20 09:11 ilippert

It is still the same issue JabRef 5.3--2021-01-07--129abaa Linux 5.9.16-200.fc33.x86_64 amd64 Java 15.0.1

ilippert avatar Jan 07 '21 17:01 ilippert

Can you please try again with the latest version? I updated the javafx version

Siedlerchr avatar Jan 08 '21 14:01 Siedlerchr

Hi, at JabRef 5.3--2021-01-09--86852c6 Linux 5.9.16-200.fc33.x86_64 amd64 Java 15.0.1 JavaFX 15.0.1+1

I do not get any reaction - no error message but neither is a pdf attached.

ilippert avatar Jan 10 '21 12:01 ilippert

Hi,

at JabRef 5.3--2021-02-03--242a494 Linux 5.10.11-200.fc33.x86_64 amd64 Java 15.0.2 JavaFX 15.0.1+1 I get

Log File
java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

and the pdf does not get attached.

ilippert avatar Feb 05 '21 19:02 ilippert

See also https://gitlab.gnome.org/GNOME/nautilus/-/issues/1745

ilippert avatar Feb 12 '21 09:02 ilippert

Hi,

at JabRef 5.3--2021-03-19--049acb9 Linux 5.11.7-200.fc33.x86_64 amd64 Java 15.0.2 JavaFX 16+8 I get

Log File
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)


and the pdf does get attached when I drag and drop onto the File field of an entry/in entry editor.

ilippert avatar Mar 22 '21 10:03 ilippert

@ilippert damn, I hoped that the bug was fixed with jfx16 :/ Did you press any modifier key? Can you try with shift/ctrl/alt... And the exception from the log seems to be missing some lines wich state the cause, but that seems like the same as in your other post

Siedlerchr avatar Mar 22 '21 11:03 Siedlerchr

Hi, pressing/not pressing modifier keys does not prevent the error message.

 And the exception from the log seems to be missing some lines wich state the cause, but that seems like the same as in your other post 

well that is what JabRef offers to me.

ilippert avatar Mar 25 '21 09:03 ilippert

When I attach a file, it does attach, but I get an error in

JabRef 5.3--2021-07-16--c99d61c Linux 5.13.8-200.fc34.x86_64 amd64 Java 16.0.1 JavaFX 16+8

Log File

java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source) at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source) at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source) at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Aug 15 '21 08:08 ilippert

This is the complete error message that JabRef offers to me.

I did not press any keys whilst drag & drop.

ilippert avatar Aug 15 '21 08:08 ilippert

error still at JabRef 5.4--2021-08-15--96061b7 Linux 5.13.9-200.fc34.x86_64 amd64 Java 16.0.2 JavaFX 16+8

ilippert avatar Aug 16 '21 06:08 ilippert

Good news, this might be fixed with the upcoming JavaFX17 version which will be released soon

Siedlerchr avatar Aug 17 '21 11:08 Siedlerchr

@ilippert This will be hopefully fixed in the next master/main version (currently building). Javafx 17 got released and this should fix it.

Siedlerchr avatar Sep 09 '21 18:09 Siedlerchr

Hi,

on

JabRef 5.4--2021-09-10--6c145fc Linux 5.13.14-200.fc34.x86_64 amd64 Java 16.0.2 JavaFX 17+18

I get this error AND no file gets attached.

	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Sep 12 '21 10:09 ilippert

JabRef 5.4--2021-09-20--a91420d Linux 5.13.16-200.fc34.x86_64 amd64 Java 16.0.2 JavaFX 17+18

I get this error AND file DOES get attached.

	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Sep 21 '21 07:09 ilippert

JabRef 5.4--2021-09-20--a91420d Linux 5.13.16-200.fc34.x86_64 amd64 Java 16.0.2 JavaFX 17+18

I cannot attach a folder to the entry.

	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Sep 22 '21 08:09 ilippert

It seems like they recognized that this bug is still occuring under linux https://bugs.openjdk.java.net/browse/JDK-8275033

Siedlerchr avatar Oct 23 '21 10:10 Siedlerchr

It seems like they recognized that this bug is still occuring under linux https://bugs.openjdk.java.net/browse/JDK-8275033

I was facing the same problem for an entirely different project using Fedora Linux 36 and drag and drop events. After a lengthy Reddit discussion, Nir Lisker got this issue reopened. It is still present in JavaFX 19 and below. Hopefully it will gain some traction.

CodeDead avatar Sep 15 '22 11:09 CodeDead

After updating to JabRef 5.9, I am experiencing the same issue. When dragging a PDF onto an existing entry, I am receiving an Uncaught exception occured in Thread[#31,JavaFX Application Thread,5,main] exception.

JabRef version: 5.9 Operating system: Ubuntu 22.04.1 LTS 64-bit GNOME Version: GNOME 42.5 Windowing System: Wayland Kernel: Linux 5.15.0-58-generic #64-Ubuntu SMP

Log File
java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

philipptempel avatar Feb 03 '23 08:02 philipptempel

@philipptempel The issue lies in the JFX SDK and will be fixed in openjfx21, which will be released at an unknown date as of today. It could be months, but it has nothing to do with the application itself

CodeDead avatar Feb 03 '23 11:02 CodeDead

I just checked, in my reading of https://github.com/openjdk/jfx/commit/7e54b637c9742b8d19c902af21adca9313ba9204 we are now at openjfx22. But the issue has not changed in my experience with JabRef.

JabRef 5.10--2023-07-04--ffedea2 Linux 6.4.8-200.fc38.x86_64 amd64 Java 21-internal JavaFX 20+19

ilippert avatar Aug 10 '23 07:08 ilippert

@ilippert Java & javafx are independent. We are still using javafx 20 as the version number you posted reports :)

Siedlerchr avatar Aug 10 '23 07:08 Siedlerchr

To chime in on the recent activity: I do no longer have the problem / error when dragging files to JabRef. Neither on macOS nor on Linux.

JabRef 5.9--2023-01-08--76253f1a7
Mac OS X 13.4.1 x86_64 
Java 19.0.1 
JavaFX 19+11

philipptempel avatar Aug 11 '23 09:08 philipptempel

I am on

JabRef 5.11--2023-09-25--bc8fb3f
Linux 6.5.5-200.fc38.x86_64 amd64 
Java 21-internal 
JavaFX 20.0.2+3

and the issue persists

Log File
java.lang.NullPointerException: Cannot read field "dragboard" because "this.this$0.dndGesture" is null
	at [email protected]/javafx.scene.Scene$DropTargetListener.drop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$11(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyDragDrop(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ilippert avatar Sep 26 '23 10:09 ilippert

Might be fixed by the newer javafx version, but we are currently blocked by a third party component and cannot upgrade

Siedlerchr avatar Sep 26 '23 10:09 Siedlerchr