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

ACM Portal websearch bug #10107

Closed
2 tasks done
ghost opened this issue Jul 23, 2023 · 2 comments · Fixed by #10142
Closed
2 tasks done

ACM Portal websearch bug #10107

ghost opened this issue Jul 23, 2023 · 2 comments · Fixed by #10142
Labels
bug Confirmed bugs or reports that are very likely to be bugs fetcher good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@ghost
Copy link

ghost commented Jul 23, 2023

JabRef version

5.9 (latest release)

Operating system

Windows

Details on version and operating system

Windows 10 22H2

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

  1. Go to search on the web: ACM Portal
  2. Enter the test string "dd"
  3. See the error message below

afbeelding

Appendix

...

Log File

Not updating theme because it hasn't changed
Theme set to Theme{type=EMBEDDED, name='Dark.css'} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css}
No open database detected
Aan het openen: 'F:\DATA (op externe HDD)\DINOSAURUS BOEK\Dinosaurus Boek.bib'
Aan het openen: 'F:\DATA (op externe HDD)\DINOSAURUS BOEK\Dinosaurus Paper\Dinosaurus Paper.bib'
Index path for F:\DATA (op externe HDD)\DINOSAURUS BOEK\Dinosaurus Paper\Dinosaurus Paper.bib is C:\Users\gebruiker\AppData\Local\org.jabref\JabRef\lucene94
Index path for F:\DATA (op externe HDD)\DINOSAURUS BOEK\Dinosaurus Boek.bib is C:\Users\gebruiker\AppData\Local\org.jabref\JabRef\lucene94
Error importing
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
at [email protected]/org.jabref.logic.importer.fileformat.ACMPortalParser.parseBibEntry(Unknown Source)
at [email protected]/org.jabref.logic.importer.fileformat.ACMPortalParser.getBibEntriesFromDoiList(Unknown Source)
at [email protected]/org.jabref.logic.importer.fileformat.ACMPortalParser.parseEntries(Unknown Source)
at [email protected]/org.jabref.logic.importer.SearchBasedParserFetcher.getBibEntries(Unknown Source)
at [email protected]/org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(Unknown Source)
at [email protected]/org.jabref.logic.importer.SearchBasedFetcher.performSearch(Unknown Source)
at [email protected]/org.jabref.gui.importer.fetcher.WebSearchPaneViewModel.lambda$search$3(Unknown Source)
at [email protected]/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
at [email protected]/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
at [email protected]/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

@ghost
Copy link
Author

ghost commented Jul 23, 2023

This error seems to appear only with certain search strings like "dd". Other search strings don't generate this error

@ThiloteE ThiloteE added bug Confirmed bugs or reports that are very likely to be bugs fetcher labels Jul 26, 2023
@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Jul 26, 2023
@ThiloteE ThiloteE changed the title ACM Portal search bug ACM Portal websearch bug Jul 26, 2023
@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Jul 26, 2023
@Siedlerchr
Copy link
Member

Siedlerchr commented Jul 26, 2023

The author parsing fails because the author only has a family name, not a given name

There needs to be a check for the attribute, best checking if both exist

{"family":"Ngo-Thi-Thu-Trang"}

authorJsonObject.get("given").getAsString() + " " + authorJsonObject.get("family").getAsString()

ERROR: Error importing: java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
	at org.jabref/org.jabref.logic.importer.fileformat.ACMPortalParser.parseBibEntry(ACMPortalParser.java:157)
	at org.jabref/org.jabref.logic.importer.fileformat.ACMPortalParser.getBibEntriesFromDoiList(ACMPortalParser.java:102)
	at org.jabref/org.jabref.logic.importer.fileformat.ACMPortalParser.parseEntries(ACMPortalParser.java:53)
	at org.jabref/org.jabref.logic.importer.SearchBasedParserFetcher.getBibEntries(SearchBasedParserFetcher.java:59)
	at org.jabref/org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(SearchBasedParserFetcher.java:54)
	at org.jabref/org.jabref.logic.importer.SearchBasedFetcher.performSearch(SearchBasedFetcher.java:51)
	at org.jabref/org.jabref.gui.importer.fetcher.WebSearchPaneViewModel.lambda$2(WebSearchPaneViewModel.java:144)
	at org.jabref/org.jabref.gui.util.BackgroundTask$1.call(BackgroundTask.java:60)
	at org.jabref/org.jabref.gui.util.DefaultTaskExecutor$1.call(DefaultTaskExecutor.java:161)
	at javafx.graphics@20/javafx.concurrent.Task$TaskCallable.call(Task.java:1426)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)

Siedlerchr added a commit that referenced this issue Aug 4, 2023
Fix cli debug log option

Fixes #10107
Follow up from #10137
@github-project-automation github-project-automation bot moved this from Normal priority to Done in Prioritization Aug 4, 2023
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 good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants