title: Exception while parsing JSON using org.simple
body: <p>I am creating a JSON file and saving it a location. When the files are creating for the first time, there are no issues. But if the file exists and it should update the existing JSON file in the same location i am getting the following exception:<br><br>
  <strong>Exception:</strong></p>
  
  <pre><code>Unexpected character (-) at position 138.
  at org.json.simple.parser.Yylex.yylex(Unknown Source)
  at org.json.simple.parser.JSONParser.nextToken(Unknown Source)
  at org.json.simple.parser.JSONParser.parse(Unknown Source)
  at org.json.simple.parser.JSONParser.parse(Unknown Source)
  at nbclearn.edgate.executorService.ExecService$1.run(ExecService.java:116)
  at 
  Unexpected character (d) at position 123.
  at org.json.simple.parser.Yylex.yylex(Unknown Source)
  at org.json.simple.parser.JSONParser.nextToken(Unknown Source)
  at org.json.simple.parser.JSONParser.parse(Unknown Source)
  at org.json.simple.parser.JSONParser.parse(Unknown Source)
  at nbclearn.edgate.executorService.ExecService$1.run(ExecService.java:116)
  at 
  
  Unexpected token END OF FILE at position 0.
  at org.json.simple.parser.JSONParser.parse(Unknown Source)
  at org.json.simple.parser.JSONParser.parse(Unknown Source)
  at nbclearn.edgate.executorService.ExecService$1.run(ExecService.java:116)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p><strong>File Writting:</strong></p>
  
  <pre><code>BufferedWriter writer = new BufferedWriter(
                                          new OutputStreamWriter(new FileOutputStream("/Users/smo/Desktop/Ed/"+id+".json"),
                                                  "utf-8"));
                                  try {
                                      writer.write(jsonDATA);
                                      }
  
                                      System.out.println("Done");
                                  } finally {
                                      writer.close();
                                  }
  </code></pre>
  
  <p>I am using org.simple libraru to see if the json file exists in the location , else it should create new file. If it exists it should update it.</p>
  
  <p><strong>Code for Checking the JSON File:</strong></p>
  
  <pre><code>Path p = Paths.get("/Users/smo/Desktop/Ed/"+id + ".json");
                                  boolean exists = Files.exists(p);
                                  if(exists){
                                  Object obj = parser.parse(new FileReader(
                                          "/Users/smo/Desktop/Ed/"+id + ".json"));
                                  org.json.simple.JSONObject jsonObject = (org.json.simple.JSONObject) obj;
  </code></pre>
  
  <p><strong>JSON Data:</strong></p>
  
  <pre><code>{“id1-position-backstik”: [“4289998”, "422212998", "49998", “638737”],”sum”:2a7c0d20-baf1-4c37-8ac5-eb14198eed06,”position”:1 }
  
  
                                  }
  </code></pre>
  
  <p>Can anyone please suggest.Thanks in Advance.</p>