Fetch defect from rally using rally rest api v2.0 -


i getting following exception whenever try fetch defects rally:

            com.google.gson.jsonsyntaxexception:              com.google.gson.stream.malformedjsonexception: use  jsonreader.setlenient(true) accept malformed json @ line 1 column 12             @ com.google.gson.jsonparser.parse(jsonparser.java:65)             @ com.google.gson.jsonparser.parse(jsonparser.java:45)             @ com.rallydev.rest.response.response.<init>(response.java:25)             @ com.rallydev.rest.response.queryresponse.<init>(queryresponse.java:16)             @ com.rallydev.rest.rallyrestapi.query(rallyrestapi.java:168)             @ test.main(test.java:86)             caused by: com.google.gson.stream.malformedjsonexception: use jsonreader.setlenient(true) accept malformed json @ line 1 column 12             @ com.google.gson.stream.jsonreader.syntaxerror(jsonreader.java:1505)             @ com.google.gson.stream.jsonreader.checklenient(jsonreader.java:1386)             @ com.google.gson.stream.jsonreader.dopeek(jsonreader.java:531)             @ com.google.gson.stream.jsonreader.peek(jsonreader.java:414)             @ com.google.gson.jsonparser.parse(jsonparser.java:60)             ... 5 

what intrigues me code works fine on few machines , throws above exception on few.

code snippet :

rallyrestapi restapi =  new rallyrestapi(new uri("http://rally1.rallydev.com"),apikey); queryrequest queryrequest = new queryrequest("defects"); queryrequest.setfetch(new fetch("project","formattedid","release")); queryfilter filter1 = new queryfilter("formattedid", "=", defetctid); queryresponse queryresponse1 =  restapi.query(queryrequest); 

try curl command read same defect using same apikey (in zsessionid header) on same machine java code fails.

curl --header "zsessionid: _abc123" "https://rally1.rallydev.com/slm/webservice/v2.0/defect/123456789" 

at least know if specific java or not. yes, strange fails on machines , works on others, timing of tests not obvious post, , wonder if has underlying user credentials. (a user gets disabled period of time after number of unsuccessful attempts). not positive issue experience have seen when expired password caused exact same error. api keys tied user, when user's password expired, or when user inactivated (disabled) same permissions(or lack of them) reflected in key. example, user did not know password expired because in rally ui used sso authentiation, in code used either username/password or apikey since toolkit not support sso @ point. 401 error more helpful, instead malformed json generated.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -