JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.54k stars 2.47k forks source link

Cannot drag multiple PDF files to import into Jabref #8355

Open starsareintherose opened 2 years ago

starsareintherose commented 2 years ago

JabRef version

5.4 (latest release)

Operating system

GNU / Linux

Details on version and operating system

ArchLinux

Checked with the latest development build

Steps to reproduce the behaviour

  1. drag multi-files into the jabref
  2. no response

Appendix

...

Log File ``` 2021-12-22 15:54:35 [pool-2-thread-4] org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata() ERROR: Problem parsing XMP schema. Continuing with other schemas.: java.io.IOException: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://prismstandard.org/namespaces/basic/3.0/ at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(XmpUtilShared.java:34) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(XmpUtilReader.java:142) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilReader.readXmp(XmpUtilReader.java:74) at org.jabref@5.4/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(PdfXmpImporter.java:58) at org.jabref@5.4/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(PdfMergeMetadataImporter.java:81) at org.jabref@5.4/org.jabref.logic.externalfiles.ExternalFilesContentImporter.importPDFContent(ExternalFilesContentImporter.java:29) at org.jabref@5.4/org.jabref.gui.externalfiles.ImportHandler$1.call(ImportHandler.java:95) at org.jabref@5.4/org.jabref.gui.externalfiles.ImportHandler$1.call(ImportHandler.java:72) at org.jabref@5.4/org.jabref.gui.util.DefaultTaskExecutor$1.call(DefaultTaskExecutor.java:162) at javafx.graphics/javafx.concurrent.Task$TaskCallable.call(Task.java:1426) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://prismstandard.org/namespaces/basic/3.0/ at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(DomXmpParser.java:891) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(DomXmpParser.java:297) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:241) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:205) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(XmpUtilShared.java:31) ... 15 more 2021-12-22 15:54:35 [pool-2-thread-4] org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata() ERROR: Problem parsing XMP schema. Continuing with other schemas.: java.io.IOException: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://crossref.org/crossmark/1.0/ at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(XmpUtilShared.java:34) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(XmpUtilReader.java:142) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilReader.readXmp(XmpUtilReader.java:74) at org.jabref@5.4/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(PdfXmpImporter.java:58) at org.jabref@5.4/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(PdfMergeMetadataImporter.java:81) at org.jabref@5.4/org.jabref.logic.externalfiles.ExternalFilesContentImporter.importPDFContent(ExternalFilesContentImporter.java:29) at org.jabref@5.4/org.jabref.gui.externalfiles.ImportHandler$1.call(ImportHandler.java:95) at org.jabref@5.4/org.jabref.gui.externalfiles.ImportHandler$1.call(ImportHandler.java:72) at org.jabref@5.4/org.jabref.gui.util.DefaultTaskExecutor$1.call(DefaultTaskExecutor.java:162) at javafx.graphics/javafx.concurrent.Task$TaskCallable.call(Task.java:1426) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://crossref.org/crossmark/1.0/ at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(DomXmpParser.java:891) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(DomXmpParser.java:297) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:241) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:205) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(XmpUtilShared.java:31) ... 15 more 2021-12-22 15:54:35 [pool-2-thread-4] org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata() ERROR: Problem parsing XMP schema. Continuing with other schemas.: java.io.IOException: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://www.niso.org/schemas/jav/1.0/ at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(XmpUtilShared.java:34) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(XmpUtilReader.java:142) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilReader.readXmp(XmpUtilReader.java:74) at org.jabref@5.4/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(PdfXmpImporter.java:58) at org.jabref@5.4/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(PdfMergeMetadataImporter.java:81) at org.jabref@5.4/org.jabref.logic.externalfiles.ExternalFilesContentImporter.importPDFContent(ExternalFilesContentImporter.java:29) at org.jabref@5.4/org.jabref.gui.externalfiles.ImportHandler$1.call(ImportHandler.java:95) at org.jabref@5.4/org.jabref.gui.externalfiles.ImportHandler$1.call(ImportHandler.java:72) at org.jabref@5.4/org.jabref.gui.util.DefaultTaskExecutor$1.call(DefaultTaskExecutor.java:162) at javafx.graphics/javafx.concurrent.Task$TaskCallable.call(Task.java:1426) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://www.niso.org/schemas/jav/1.0/ at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(DomXmpParser.java:891) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(DomXmpParser.java:297) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:241) at org.apache.xmpbox@2.0.24/org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:205) at org.jabref@5.4/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(XmpUtilShared.java:31) ... 15 more ```
ThiloteE commented 2 years ago

Would it be possible for you to upload one or a few of the pdf-files that make problems? So far i cannot reproduce this on my Windows System.

starsareintherose commented 2 years ago

sorry, this is performed on ArchLinux instead of Windows

ThiloteE commented 2 years ago

I know, but since it has to do with XMP-metadata, i want to check if and what metadata is attached to the files and if i also get the same problem if i use your PDFs. After this we could exclude that the problem is caused by the specific characteristics of the pdf file.

starsareintherose commented 2 years ago

jbi.14.zip try this

ThiloteE commented 2 years ago

I indeed cannot reproduce on Windows. No error.

When i imported XMP-Metadata manually via the import dialogue, the only data that Jabref fetched was the DOI:

@Misc{,
  doi  = {doi:10.1111/jbi.14107},
}

I checked one entry with exiftool and found no XMP-metadata attached:

File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.6
Linearized                      : No
Creator                         : Adobe InDesign 15.1 (Windows)
Modify Date                     : 2021:06:09 01:44:29-07:00
Create Date                     : 2021:05:18 20:23:58+05:30
Producer                        : Adobe PDF Library 15.0; modified using iText 4.2.0 by 1T3XT
Subject                         : Journal of Biogeography 0.0:null-null
WPS-PROCLEVEL                   : 3
WPS-JOURNALDOI                  : 10.1111/(ISSN)1365-2699
Title                           : Spatial phylogenomics of acrobat ants in MadagascarÔÇöMountains function as cradles for recent diversity and endemism
WPS-ARTICLEDOI                  : 10.1111/jbi.14107
Page Mode                       : UseThumbs
Format                          : application/pdf
Identifier                      : doi:10.1111/jbi.14107
Digital Object Identifier       : 10.1111/jbi.14107
URL                             : https://doi.org/10.1111/jbi.14107
Major Version Date              : 2021-05-16
Crossmark Domain Exclusive      : true
Cross Mark Domains              : onlinelibrary.wiley.com
Doi                             : 10.1111/jbi.14107
Crossmark Major Version Date    : 2021-05-16
Language                        : en-US
Page Count                      : 14
ThiloteE commented 2 years ago

May this be of help to the one(s) that looks at the code.

starsareintherose commented 2 years ago

1-s2.0-S1055790321000956-main.pdf 1-s2.0-S1055790321001159-main.pdf 1-s2.0-S1055790321001299-main.pdf 1-s2.0-S1055790321001421-main.pdf These files can not import

ThiloteE commented 2 years ago

Hey, could you please try the newest development version of Jabref? There has been at least one more fix for import of PDFs. Maybe it works now? You can find the development version here: https://builds.jabref.org/main/

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

Not all can be import

philipptempel commented 1 year ago

This may be related to #7072

Siedlerchr commented 1 year ago

At least for mac there seems to be PR from the openjfx team now https://github.com/openjdk/jfx/pull/1089 Maybe for linux it's already working? Please try someone the latest dev version

philipptempel commented 1 year ago

Negative, cannot confirm that it works on my machine with the following "About JabRef" output:

JabRef 5.10--2023-04-16--d47ed31
Linux 5.19.0-38-generic amd64 
Java 19.0.2 
JavaFX 20+19

Still getting the same Cannot read file "dragboard" because "this.this$0.dndGesture" is null error.

The exception stracktrace was

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

Siedlerchr commented 1 year ago

this is an javafx exception thing

koppor commented 1 year ago

Can an MWE created and a bug filed?

ThiloteE commented 1 year ago

I have checked all files that were posted in this thread and i can drag and drop them successfully into JabRef, if I drag and drop them one by one. Entries are created with nice metadata.

  JabRef 5.10--2023-04-10--e7f55d9
  Windows 10 10.0 amd64 
  Java 19.0.2 
  JavaFX 20+19

There are two separate issues:

philipptempel commented 1 year ago

For me, the issue presents itself when dragging a single PDF or multiple PDFs into JabRef--either dropping them onto an existing entry i.e., linking as file, or when dropping them as "import from metadata'. In any case, dragging PDF files onto JabRef throws the exception, and for what it's worth, it is related to #7072.

After checking on macOS just now with JabRef 5.10--2023-04-18--dab8516, I am no longer getting the exception thrown there. I will try later on ubuntu to see if it works with the more recent development version (tried it before with JabRef 5.10--2023-04-16--d47ed31)