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

export via command line fails #2273

Closed
bastistician opened this issue Nov 15, 2016 · 7 comments
Closed

export via command line fails #2273

bastistician opened this issue Nov 15, 2016 · 7 comments
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs

Comments

@bastistician
Copy link

JabRef versions 3.3 - 3.7 on Ubuntu 14.04 and 16.04.

Steps to reproduce:

  1. Download JabRef's jar file for any of the releases 3.3 to 3.7
  2. Create or find a bib file, references.bib, say (an example is given below)
  3. Try java -jar JabRef-3.7.jar -n -o references.html,tablerefsabsbib references.bib (other export formats do not work either)

In current JabRef 3.7, no html file is produced and the output is:

09:57:04.556 [AWT-EventQueue-0] INFO  net.sf.jabref.logic.importer.OpenDatabase - Opening: references.bib
Exporting: references.html
Could not export file 'references.html': null

Note: exporting bibfiles via the GUI works flawlessly.

In JabRef 3.2, the html file is produced correctly and the output is:

Nov 15, 2016 9:51:39 AM net.sf.jabref.JabRef openBibFile
INFO: Opening: references.bib
Exporting: references.html
Nov 15, 2016 9:51:39 AM net.sf.jabref.exporter.ExportFormat performExport
WARNING: []

I used the following simple references.bib:

@Book{key,
  Title = {Title},
  Author = {An Author},
  Publisher = {A Publisher},
  Year = {2016},
  Address = {Address}
}
@stefan-kolb stefan-kolb added the bug Confirmed bugs or reports that are very likely to be bugs label Nov 17, 2016
@alephreish
Copy link

I can confirm the bug for v. 3.8 (Ubuntu 14.04), it is IMO a very serious problem.

Each one of the exporters listed in jabref -h:

for format in MSBib bibordf bibtexml din1505 docbook endnote harvard html iso690rtf iso690txt listrefs misq mods ods oocalc oocsv ris simplehtml tablerefs tablerefsabsbib; do
	jabref -n -o references.$format,$format references.bib
done

fails with:

22:19:31.879 [AWT-EventQueue-0] INFO  net.sf.jabref.logic.importer.OpenDatabase - Opening: references.bib
Exporting: references.<format>
Could not export file 'references.<format>': null

@Siedlerchr
Copy link
Member

Confirmed on Windows 7 x64, too.
I will look into that.

@Siedlerchr Siedlerchr self-assigned this Nov 28, 2016
@Siedlerchr
Copy link
Member

Siedlerchr commented Nov 28, 2016

I could boil it down to a NPE in ExportFormat

Seems to be a mismatch beetween the assumption:

entries (may be null) A list containing all entries that should be exported. If null, all entries will be exported.

However, if null it fails with an NPE as it explictiyl requires non null

java.lang.NullPointerException: Entries must not be null!
	at java.util.Objects.requireNonNull(Unknown Source)
	at net.sf.jabref.logic.exporter.ExportFormat.performExport(ExportFormat.java:198)
	at net.sf.jabref.cli.ArgumentProcessor.exportFile(ArgumentProcessor.java:389)
	at net.sf.jabref.cli.ArgumentProcessor.processArguments(ArgumentProcessor.java:141)
	at net.sf.jabref.cli.ArgumentProcessor.<init>(ArgumentProcessor.java:77)

Siedlerchr added a commit that referenced this issue Nov 28, 2016
@Siedlerchr
Copy link
Member

@WastlM @har-wradim
I fixed this in this build version. Export via commandline works again and manual export still does work.
It would be nice if you can confirm that,
http://builds.jabref.org/cmdexport/

@alephreish
Copy link

Looks good.

matthiasgeiger pushed a commit that referenced this issue Nov 29, 2016
* Fix exporting via commandline in no gui mode
Fix for #2273
Adjusted javadoc

* Fixed changelog entry
Remove string messages from requireNonNull
@Siedlerchr
Copy link
Member

The patch has been merged and is available in the next development build of the master.
Therfore I close this.

@bastistician
Copy link
Author

Great, thanks! I have tested JabRef-3.8-dev--snapshot--2016-11-30--master--9c91dbb.jar and can confirm that exports via the command line now work as expected. The console output of

java -jar JabRef-3.8-dev--snapshot--2016-11-30--master--9c91dbb.jar -n -o references.html,tablerefsabsbib references.bib

is

09:14:46.793 [AWT-EventQueue-0] INFO  net.sf.jabref.logic.importer.OpenDatabase - Opening: references.bib
Exporting: references.html

The resulting html file is identical to the one generated from an export via the GUI.

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
Projects
None yet
Development

No branches or pull requests

5 participants