Wikidata/Wikidata-Toolkit-Examples

FetchOnlineDataExample dies with NPE

Closed this issue · 2 comments

*** It does not download any dump files.


*** Fetching data for one entity:
The current revision of the data for entity Q42 is 287075311
The English name for entity Q42 is Douglas Adams
*** Fetching data for several entities:
Exception in thread "main" java.lang.NullPointerException
at org.wikidata.wdtk.wikibaseapi.ApiConnection.fillCookies(ApiConnection.java:544)
at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendRequest(ApiConnection.java:346)
at org.wikidata.wdtk.wikibaseapi.WbGetEntitiesAction.wbGetEntities(WbGetEntitiesAction.java:187)
at org.wikidata.wdtk.wikibaseapi.WbGetEntitiesAction.wbGetEntities(WbGetEntitiesAction.java:96)
at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocumentMap(WikibaseDataFetcher.java:254)
at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocuments(WikibaseDataFetcher.java:161)
at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocuments(WikibaseDataFetcher.java:141)
at FetchOnlineDataExample.main(FetchOnlineDataExample.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

It's fixed by using Wikidata-Toolkit 0.6.0-SNAPSHOT, so a bugfix release may be needed
The commit that fixed it:
Wikidata/Wikidata-Toolkit@3e4ba58#diff-41e3ffd5685b98c07942fab869a09a35

This has been fixed now by using Wikidata Toolkit 0.6.0 as a dependency.