Grox18 / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

com.google.gson.ParseException: Encountered " <IDENTIFIER_SANS_EXPONENT> "access_token "" at line 1, column 1. #295

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am getting the below error while parsing the JSON response:
access_token=149368218440158|50f0e0c6b08ccdb7ada52ded-1020078280|GpLTaXrOlS9R-GR
vkc7H5iIc1_g

com.google.gson.ParseException: Encountered " <IDENTIFIER_SANS_EXPONENT> 
"access_token "" at line 1, column 1.
Was expecting one of:
    <EOF> 
    <DIGITS> ...
    "null" ...
    "NaN" ...
    "Infinity" ...
    <BOOLEAN> ...
    <SINGLE_QUOTE_LITERAL> ...
    <DOUBLE_QUOTE_LITERAL> ...
    ")]}\'\n" ...
    "{" ...
    "[" ...
    "-" ...

    at com.google.gson.JsonParserJavacc.generateParseException(JsonParserJavacc.java:705)
    at com.google.gson.JsonParserJavacc.jj_consume_token(JsonParserJavacc.java:587)
    at com.google.gson.JsonParserJavacc.parse(JsonParserJavacc.java:62)
    at com.google.gson.JsonParser.parse(JsonParser.java:54)
    at com.nbcareer.utils.FacebookIntegrator.getFaceBookAccessToken(FacebookIntegrator.java:273)
    at org.apache.jsp.WEB_002dINF.jsp.tile.jobsearch.newJobSearch_002dbody_jsp._jspService(newJobSearch_002dbody_jsp.java:173)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Original issue reported on code.google.com by kasiram....@gmail.com on 10 Mar 2011 at 6:21

GoogleCodeExporter commented 9 years ago
If that is the full text, that is not json, but looks to be an 
application/x-www-form-urlencoded response. If that is not the full text, you 
might want to provide a full sample that produces the bug.

Original comment by nairb...@gmail.com on 30 Mar 2011 at 9:10

GoogleCodeExporter commented 9 years ago
This is not a valid JSON object so I am going to close this issue out. If you 
have more information then please feel free to open a new bug.

As well, you are using an older version of Gson. If you upgrade to 1.6 (or in a 
week or so we'll have 1.7) then you will get the new Json Parser that has some 
significant performance improvements.

Original comment by joel.leitch@gmail.com on 4 Apr 2011 at 9:39