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

4.0 Crossref Websearch fails with "Parser error" #3376

Closed
jonasstein opened this issue Oct 31, 2017 · 2 comments
Closed

4.0 Crossref Websearch fails with "Parser error" #3376

jonasstein opened this issue Oct 31, 2017 · 2 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs fetcher

Comments

@jonasstein
Copy link

jonasstein commented Oct 31, 2017

JabRef version

JabRef 4.0
Linux 4.12.12-gentoo+ amd64 
Java 1.8.0_152

Steps to reproduce:
search for 10.1103/PhysRevLett.119.177201
selection_369

selection_368


14:11:58.427 [JabRef CachedThreadPool] ERROR org.jabref.gui.importer.fetcher.SearchBasedEntryFetcher - Error while fetching from Crossref
org.jabref.logic.importer.FetcherException: An internal parser error occurred
	at org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(SearchBasedParserFetcher.java:72) ~[JabRef-4.0.jar:?]
	at org.jabref.gui.importer.fetcher.SearchBasedEntryFetcher.processQuery(SearchBasedEntryFetcher.java:37) ~[JabRef-4.0.jar:?]
	at org.jabref.gui.importer.fetcher.GeneralFetcher.lambda$actionPerformed$5(GeneralFetcher.java:216) ~[JabRef-4.0.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]
Caused by: org.jabref.logic.importer.ParseException: CrossRef API JSON format has changed
	at org.jabref.logic.importer.fetcher.CrossRef.jsonItemToBibEntry(CrossRef.java:131) ~[JabRef-4.0.jar:?]
	at org.jabref.logic.importer.fetcher.CrossRef.lambda$getParser$3(CrossRef.java:88) ~[JabRef-4.0.jar:?]
	at org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(SearchBasedParserFetcher.java:60) ~[JabRef-4.0.jar:?]
	... 5 more
Caused by: org.json.JSONException: JSONObject["title"] not found.
	at org.json.JSONObject.get(JSONObject.java:471) ~[JabRef-4.0.jar:?]
	at org.json.JSONObject.getJSONArray(JSONObject.java:618) ~[JabRef-4.0.jar:?]
	at org.jabref.logic.importer.fetcher.CrossRef.jsonItemToBibEntry(CrossRef.java:113) ~[JabRef-4.0.jar:?]
	at org.jabref.logic.importer.fetcher.CrossRef.lambda$getParser$3(CrossRef.java:88) ~[JabRef-4.0.jar:?]
	at org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(SearchBasedParserFetcher.java:60) ~[JabRef-4.0.jar:?]
	... 5 more

@lenhard
Copy link
Member

lenhard commented Oct 31, 2017

Thanks for bringing this up!

The error message reads CrossRef API JSON format has changed. I wish they would do this less frequently... Anyway, we will have to adapt the code to conform to the new format.

@lenhard lenhard added bug Confirmed bugs or reports that are very likely to be bugs fetcher labels Oct 31, 2017
@lenhard
Copy link
Member

lenhard commented Oct 31, 2017

Appologies to CrossRef, they did not change the format. The error was actually that the search returned a few entries from CrossRef that do have titles and our code wasn't able to handle that.

I submitted a fix as pull request, it should be merged soon.

@jonasstein jonasstein changed the title Crossref Websearch fails with "Parser error" 4.0 Crossref Websearch fails with "Parser error" Oct 31, 2017
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 fetcher
Projects
None yet
Development

No branches or pull requests

2 participants