Skip to content

Fetch Online Data Example - Token Parsing Error #7

@horaciovelvetine

Description

@horaciovelvetine

Hello!

I use this library to grab details and data from Wikidata for an app I am developing for school and recently have come across an issue which I am completely stuck on. Cloning the toolkit and running the aforementioned example appears to throw an unexpected Token error from Jackson when trying to read/deserialize some data.

I attempted to dig into this issue to the best of my (very limited) knowledge and found mention of the REST API transition in this issue:
Wikidata-Toolkit/Wikidata-Toolkit#755 - and was wondering if there had been any related changes of late (last 2/3 months approximately) that may have broken the ability to pull data using this library.

*** Fetching data for one entity:
Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Please': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 8]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2572)
        at com.fasterxml.jackson.core.JsonParser._constructReadException(JsonParser.java:2598)
        at com.fasterxml.jackson.core.JsonParser._constructReadException(JsonParser.java:2606)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:765)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3659)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2747)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:867)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:753)
        at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4934)
        at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:3260)
        at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendJsonRequest(ApiConnection.java:400)
        at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendJsonRequest(ApiConnection.java:367)
        at org.wikidata.wdtk.wikibaseapi.WbGetEntitiesAction.wbGetEntities(WbGetEntitiesAction.java:202)
        at org.wikidata.wdtk.wikibaseapi.WbGetEntitiesAction.wbGetEntities(WbGetEntitiesAction.java:108)
        at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocumentMap(WikibaseDataFetcher.java:404)
        at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocuments(WikibaseDataFetcher.java:187)
        at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocuments(WikibaseDataFetcher.java:156)
        at org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher.getEntityDocument(WikibaseDataFetcher.java:138)
        at examples.FetchOnlineDataExample.main(FetchOnlineDataExample.java:47)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions