RouteTask solve bug ? JsonParseException

2644
0
01-23-2014 04:27 PM
ggdd
by
New Contributor
I always get the follow Exception when the mUpdateResults call back method is run.

org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: java.io.BufferedInputStream@b3e06460; line: 10, column: 2]

The REST service URL are below and they have no problem !!  Any Help ?

Map Service URL: http://biz.gzisd.org/arcgis/rest/services/LBS/MapServer

Route Service URL:  http://biz.gzisd.org/arcgis/rest/services/LBS/NAServer/Route



And here is the main source code:

try {
      
        Point loc1 = new Point(3, 3);
       
        Point loc2 = new Point(97,50);
      
       // Start building up routing parameters
       RouteParameters rp = mRouteTask
         .retrieveDefaultRouteTaskParameters();
       NAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();
      
       // Create the stop points (start at loc1, go
       // to loc2)
      
       StopGraphic point1 = new StopGraphic(loc1);
       StopGraphic point2 = new StopGraphic(loc2);
      
      
       rfaf.setFeatures(new Graphic[] { point1, point2 });
      
       
       rp.setStops(rfaf);
      
       rp.setReturnDirections(false);
      
       
       rp.setOutSpatialReference(Spatial_Reference);

      
       mResults = mRouteTask.solve(rp);

       mHandler.post(mUpdateResults);
      } catch (Exception e) {
       mException = e;
       mHandler.post(mUpdateResults);
      }


final Runnable mUpdateResults = new Runnable() {
  public void run() {
   updateUI();
  }
};



void updateUI() {
  
  if (mResults == null) {    //it always equal to null and get JsonParseException
   Toast.makeText(HelloWorldMapActivity.this, mException.toString(),
     Toast.LENGTH_LONG).show();     
   return;
  }
                //do something here
                //.....
}
0 Kudos
0 Replies