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

java.lang.reflect.InvocationTargetException error with one field returned #35

Open
arpie71 opened this issue Mar 24, 2020 · 1 comment
Assignees

Comments

@arpie71
Copy link

arpie71 commented Mar 24, 2020

I am getting a java error with the following json data:
{"count": 10, "results": [{"id": "1976BELGRA00144", "name":""}, {"id": "1976BANGKO14711"}, {"id": "1977BANGKO25619"}, {"id": "P750089-0780"}, {"id": "1973LONDON10203"}, {"id": "1978USNATO07178"}, {"id": "1974STATE096615"}, {"id": "1978SALTT A-2053_4"}, {"id": "1976NATO04964"}, {"id": "1979LAGOS02592"}], "page_size": 10}

All the other json data I've tried work with the command. Also if I add a new field in one of the results, the command works fine. So this json data works:
{"count": 10, "results": [{"id": "P760163-2020", "name":""}, {"id": "1976STOCKH04986"}, {"id": "1978WELLIN00675"}, {"id": "Clinton-76861"}, {"id": "1975LONDON18839"}, {"id": "CAB_24_29_0_0062"}, {"id": "1975STATE001926"}, {"id": "P840139-0646"}, {"id": "1975STATE282895"}, {"id": "1976UDORN06377"}], "page_size": 10}

Here is the error:
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.stata.Javacall.load(Javacall.java:130)
at com.stata.Javacall.load(Javacall.java:90)
Caused by: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source)
at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source)
at java.base/java.util.Objects.checkIndex(Unknown Source)
at java.base/java.util.ArrayList.get(Unknown Source)
at org.paces.Stata.Input.FlatJSON.flatten(FlatJSON.java:216)
at org.paces.Stata.Input.FlatJSON.flatten(FlatJSON.java:199)
at org.paces.Stata.Input.FlatJSON.flatten(FlatJSON.java:121)
at org.paces.Stata.Input.InJSON.insheetUrl(InJSON.java:134)

@wbuchanan
Copy link
Owner

@arpie71
What field is it that you added in the example above?

@wbuchanan wbuchanan self-assigned this Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants