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

Errors when importing and/or drag and droping certain PDFs. #9383

Closed
2 tasks done
Kramer84 opened this issue Nov 18, 2022 · 1 comment · Fixed by #9385
Closed
2 tasks done

Errors when importing and/or drag and droping certain PDFs. #9383

Kramer84 opened this issue Nov 18, 2022 · 1 comment · Fixed by #9385
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files import

Comments

@Kramer84
Copy link

JabRef version

Latest development branch build (please note build date below)

Operating system

GNU / Linux

Details on version and operating system

Ubuntu 20.04.5 - GNOME 3.36.5 - JabRef 5.8

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

I have just started using JabRef and wanted to import all my local PDFs to create a bibliography file, but I encounter errors when importing certain PDF's :

  1. This happened with a specific PDF file . You can download it from this google drive link
  2. The errors arise when importing through the File->Import dialogue, as well as when drag and dropping.
  3. If multiple files were drag and dropped along with this one, the whole import operation stops once JabRef encounters the error.
  4. The log file error is different between the approaches, you can see both in the appendix.

I have tested this with JR 5.7 as well as the latest 5.8, but the error persists. It seems to be a problem with the xml parsing.

Appendix

...

Log File When Drag And Dropping
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.8.239/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(Unknown Source)
	at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(Unknown Source)
	at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.readXmp(Unknown Source)
	at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(Unknown Source)
	at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(Unknown Source)
	at org.jabref@5.8.239/org.jabref.logic.externalfiles.ExternalFilesContentImporter.importPDFContent(Unknown Source)
	at org.jabref@5.8.239/org.jabref.gui.externalfiles.ImportHandler$1.call(Unknown Source)
	at org.jabref@5.8.239/org.jabref.gui.externalfiles.ImportHandler$1.call(Unknown Source)
	at org.jabref@5.8.239/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module@5.8.239/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.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)
Caused by: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://crossref.org/crossmark/1.0/
	at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(Unknown Source)
	at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(Unknown Source)
	at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(Unknown Source)
	at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parse(Unknown Source)
	... 16 more

Log File When Using Import Dialogue
Importing in unknown format...
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/2.0/
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.readXmp(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.lambda$importUnknownFormat$0(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.importer.ImportAction.doImport(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.importer.ImportAction.lambda$automatedImport$2(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
    at org.jabref.merged.module@5.8.239/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.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)
Caused by: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://prismstandard.org/namespaces/basic/2.0/
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parse(Unknown Source)
    ... 19 more

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.8.239/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.readXmp(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.lambda$importUnknownFormat$0(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.importer.ImportAction.doImport(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.importer.ImportAction.lambda$automatedImport$2(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
    at org.jabref.merged.module@5.8.239/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.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)
Caused by: org.apache.xmpbox.xml.XmpParsingException: Cannot find a definition for the namespace http://crossref.org/crossmark/1.0/
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parse(Unknown Source)
    ... 19 more

Error importing
java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName
    at java.xml/javax.xml.namespace.QName.<init>(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomHelper.getQName(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseChildrenAsProperties(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(Unknown Source)
    at org.jabref.merged.module@5.8.239/org.apache.xmpbox.xml.DomXmpParser.parse(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilShared.parseXmpMetadata(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.getXmpMetadata(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.xmp.XmpUtilReader.readXmp(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfXmpImporter.importDatabase(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter.importDatabase(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.lambda$importUnknownFormat$0(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source)
    at org.jabref@5.8.239/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.importer.ImportAction.doImport(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.importer.ImportAction.lambda$automatedImport$2(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
    at org.jabref@5.8.239/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
    at org.jabref.merged.module@5.8.239/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.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)

Import canceled

@Siedlerchr Siedlerchr added import bug Confirmed bugs or reports that are very likely to be bugs external files labels Nov 18, 2022
Siedlerchr added a commit that referenced this issue Nov 18, 2022
Fixes #9383

Workaround for IllegalArgumentException
Siedlerchr added a commit that referenced this issue Nov 18, 2022
* Do not break on Exception in XMP parser


Fixes #9383

Workaround for IllegalArgumentException

* changelog

* Update check-links.yaml

ignore link checker for CHANGELOG
@Siedlerchr
Copy link
Member

Thanks for raising this issue! I added a workaround so that the exception does not prevent the importer.
A new build will be ready in roughly 30 minutes.

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 import
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants