Possible Error with JavaScript API 3.9 and AGS 10.2.2 - Feature Layer

6533
6
05-13-2014 04:53 AM
VerónicaGarcía_Mesa
New Contributor II
I have an error with ArcGIS Server 10.2.2 and JavaScript API v3.9 adding a layer with Feature Layer. Initially the layer is loaded, but when browsing the map (pan, zomm, etc) the following errors appear in Chrome or IE:

Error {stack: "Error�?�    at Error (native)�?�    at Object.f.load (�?�)�?�    at http://js.arcgis.com/3.9/init.js:191:300", code: 400, message: "Unable to draw graphic (null): Failed to execute query.", details: Array[0], log: undefined�?�}
1. _ssl: undefined
2. code: 400
3. details: Array[0]
4. httpCode: 400
5. log: undefined
6. message: "Unable to draw graphic (null): Failed to execute query."
7. stack: "Error�?�    at Error (native)�?�    at Object.f.load (http://js.arcgis.com/3.9/init.js:629:424)�?�    at http://js.arcgis.com/3.9/init.js:187:69�?�    at c (http://js.arcgis.com/3.9/init.js:74:221)�?�    at d (http://js.arcgis.com/3.9/init.js:74:10)�?�    at resolve.callback (http://js.arcgis.com/3.9/init.js:75:350)�?�    at c (http://js.arcgis.com/3.9/init.js:74:436)�?�    at d (http://js.arcgis.com/3.9/init.js:74:10)�?�    at resolve.callback (http://js.arcgis.com/3.9/init.js:75:350)�?�    at http://js.arcgis.com/3.9/init.js:191:300"
8. __proto__: d


In AGS 10.2.2 the error is:

<Msg time="2014-05-12T18:12:57,121" type="SEVERE" code="9003" source="Rest" process="2112" thread="20" methodName="" machine="GIS" user="" elapsed="">Unable to process request. json</Msg>


The service was classified with a single symbology and not contains empty geometries.

This case also occurs with a other samples of AGOL, but with my AGS 10.2.2 https://developers.arcgis.com/javascript/jssamples/query_buffer.html

I have not found any ArcGIS AGOL Server with version 10.2.2 (only 10.21 or less found).


Thanks!
0 Kudos
6 Replies
JohnGravois
Frequent Contributor
can you reproduce the error with one of the public services here?
0 Kudos
VerónicaGarcía_Mesa
New Contributor II
Hi,
    I can reproduce with this service: http://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/NDFD_Precipitation/MapServer/2  

Samples: https://developers.arcgis.com/javascript/jssamples/query_buffer.html
Changes,
       var featureLayer = new FeatureLayer("http://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/NDFD_Precipitation/MapServer/2",{
       // infoTemplate: new InfoTemplate("Block: ${BLOCK}", "${*}"),


Similar error...

m {stack: "Error: Request canceled�?�    at Error (native)�?�    �?�celler (http://js.arcgis.com/3.9/init.js:753:134)", message: "Request canceled", response: Object, status: undefined, responseText: undefined�?�}
_ssl: undefined
log: undefined
message: "Unable to draw graphic (null): Request canceled"
response: Object
responseText: undefined
stack: "Error: Request canceled�?�    at Error (native)�?�    at new m (http://js.arcgis.com/3.9/init.js:223:16)�?�    at http://js.arcgis.com/3.9/init.js:177:256�?�    at cancel.b.cancel (http://js.arcgis.com/3.9/init.js:198:482)�?�    at http://js.arcgis.com/3.9/init.js:189:451�?�    at http://js.arcgis.com/3.9/init.js:186:383�?�    at x.cancel.cancel [as cancel] (http://js.arcgis.com/3.9/init.js:76:382)�?�    at m._dfdCanceller (http://js.arcgis.com/3.9/init.js:753:134)�?�    at x.cancel.cancel [as cancel] (http://js.arcgis.com/3.9/init.js:76:382)�?�    at m._dfdCanceller (http://js.arcgis.com/3.9/init.js:753:134)"
status: undefined
xhr: XMLHttpRequest
__proto__: a

Thanks
Verónica
0 Kudos
JohnGravois
Frequent Contributor
hi veronica,
i'm not able to reproduce the error you describe after updating the FeatureLayer infoTemplate to refer to a valid field and make sure not to set any renderers or symbols associated with points for the polygon layer you substituted.

http://jsfiddle.net/jagravois/LkRLu/

all that being said, its worth noting that at version 3.9 of our JS API, the dojo configuration property 'useDeferredInstrumentation' is now set to true by default, so in certain cases errors appear in the console that you wouldn't have seen in 3.8, even though nothing else has changed.

<script>
var dojoConfig = {      
  useDeferredInstrumentation: true
};
</script>
0 Kudos
ØyvindIdland
New Contributor III
The "Unable to draw graphic (null)" error has been reported in earlier versions too. It seems to happen when trying to change the extent while a layer is drawing.

I get these quite often (using Chrome as dev tool). It doesn't seem to affect my application in any way, put it is quite annoying since it pollutes the console with noise.

Some workarounds that may work:

http://forums.arcgis.com/threads/9657-Unable-to-draw-graphic-(null)-Deferred-Cancelled

http://gis.stackexchange.com/questions/33584/typeerror-unable-to-draw-graphic-geometrynull-symbolnul...
JohnGravois
Frequent Contributor
Oyvind,

thanks for that!  i was definitely able to reproduce the error when trying to pan and zoom in the middle of drawing the 1000 polygon graphics in my own feature layer.

i wrote up a quick fiddle to demonstrate how to resolve this problem based on threads you shared.
AdrianFratila
New Contributor

Hi John, 

Thanks! Your idea worked for me. One thing though, featureLayer doesn't have zoom events so map should be used instead.

"map.on("zoom-start", function() {
   featureLayer.setVisibility(false);
});

map.on("zoom-end", function() {
   featureLayer.setVisibility(true);
}); "

Regards,

Adrian

0 Kudos