Tag Archives: To solve the error

209151; org.json.JSONException A JSONObject text must begin with'{‘at character 1 of {

Cause analysis:
parse the json data, the format is not correct, is usually as a result of the returned json data outside a layer of more “” (double quotes)
if, as a string, plus @ ResponseBody annotation, then parsing json over there will more outside a layer of” ”
Solutions:

(1) if the string is converted to json, then you need to call the json packet method (string turn json object), and then forwards the json object resolution in the past.
2. If the entity object, you need to call the Json packet method (object turn Json object), and then forwards the Json object resolution in the past.
no matter what you need to turn the object data type, anyhow can not directly return to the past for Json parsing, need to convert a Json object before parsing.
Last word: it’s not easy to write. If you like it or find it helpful, remember to follow it or bookmark it

Solving Python error: local variable ‘a’ referenced before assignment

First, the cause of the problem
Defines a variable outside a function, and then use the following variables inside a function in python, and change its value, the result error local variable ‘a’ referenced before the assignment, the code is as follows:

error reason: the python functions and global variables with the same, if you have to modify the value of the variable will become a local variable, the reference to the variable nature can appear not to define such a mistake.
Second, the solution
The problem is solved by declaring a as a global variable with the global keyword:

java.sql.SQLException : IO error: socket read timed out!

When run the enterprise software mode configuration database to produce the error,
in one by one to eliminate error finally find out the reason stems from oracle listener service (OracleOraDb11g_home1TNSListener) has not started, the role of the service is the database need to remote access to start, I’m in the local PC CeShiPao project so no to this side.
successfully started.