CrossRef / rest-api-doc

Documentation for Crossref's REST API. For questions or suggestions, see https://community.crossref.org/
Other
744 stars 269 forks source link

class java.lang.ClassCastException when using select parameter #279

Closed denizk closed 6 years ago

denizk commented 7 years ago

I'm getting java.lang.ClassCastException API errors for some query.X queries that worked previously.

For example, When I interrogate the API with query string ABE, Y. [u.a.]: Increase in dicentric chromosome formation after a single CT scan in adults. Sci. Rep. (2015) 5:13882 (gutachtlich) and this request https://api.crossref.org/v1/works?rows=1&query.bibliographic=ABE%2C+Y.+%5Bu.a.%5D%3A+Increase+in+dicentric+chromosome+formation+after+a+single+CT+scan+in+adults.+Sci.+Rep.+%282015%29+5%3A13882+%28gutachtlich%29&select=DOI&select=score

produces

{
"status": "error",
"message-type": "exception",
"message-version": "1.0.0",
"message": {
"name": "class java.lang.ClassCastException",
"description": "java.lang.ClassCastException",
"message": null,
"stack": [],
"cause": null
}
}

Some more requests that fail with the ClassCastException:

https://api.crossref.org/v1/works?rows=1&query.bibliographic=Klibanov+et+al.%2C+1991%2C+Biochim.+Biophys.+Acta+1062+142.&select=DOI&select=score

https://api.crossref.org/v1/works?rows=1&query.bibliographic=Henkin+et+al.%2C+%22Sensing+Metabolic+Signals+with+nascent+RNA+transcripts%3A+the+T-box+and+S-box+riboswitches+as+paradigms%22%2C+%282007%29+Cold+Spring+Harbor+Symposia+on+Quantitative+Biology%2C+vol.+LXX1%2C+1-7.&select=DOI&select=score

https://api.crossref.org/v1/works?rows=1&query.bibliographic=WALDBAUM+S%2C+PATEL+M%2C+EPILEPSY+RES.%2C+20+October+2009+%282009-10-20%29&select=DOI&select=score

https://api.crossref.org/v1/works?rows=1&query.bibliographic=Wang%2C+et+al.+Controllable+microfluidic+production+of+multicomponent+multiple+emulsions.+Lab+Chip.+May+7%2C+2011%3B11%289%29%3A1587-92.+Epub+Apr.+1%2C+2011.&select=DOI&select=score

https://api.crossref.org/v1/works?rows=1&query.bibliographic=Bishnu%2C+S+et+al.%2C+%22Predictive+Coding+of+Speech+Signals+and+Error+Criteria%22%2C+IEEE%2C+Transactions+on+Acoustics%2C+Speech+and+Signal+Processing%2C+ASSP+27%283%29%2C%281979%29%2C+pp.+247-254.&select=DOI&select=score

denizk commented 7 years ago

When removing the select url parameter the queries succeed. Maybe an issue with the #243 implementation?

denizk commented 7 years ago

The ClassCastException seems to only occur when including the score field in the select url parameter. Unfortunately, it's a field we need for downstream analysis. Is that an easy fix @kjw ?

ale-de-vries commented 7 years ago

I get the error as well, when trying to select alternative-id.

image

denizk commented 6 years ago

any chance to get this issue fixed?

denizk commented 6 years ago

@kjw not sure how the comment above unassigned you..

jenniferlin15 commented 6 years ago

Ticketed- GO-881

markwoodhall commented 6 years ago

As long as the correct syntax is used when selecting multiple fields e.g. select=DOI,score instead of specifying the select query parameter multiple times, then this issue will be resolved by the fix for #289.