QueryTask produces NS_ERROR_XPC_NOT_ENOUGH_ARGS on Firefox works fine on IE

665
4
03-11-2011 07:32 AM
bradeckrose
New Contributor
I have a service on a file geodatabase that I query using the javascript API.    The query works fine in IE but fails with NS_ERROR_XPC_NOT_ENOUGH_ARGS on Firefox.  The stack trace from firebug is below.  

A. Anyone else have problems with firefox vs ie using esri.tasks.QueryTask and esri.tasks.Query?
B. How do you debug into dojo so you can see where the problem actually occurs?
C. Any settings or addons that could affect this?

The query is returning polygon geometry for 200-300 features with no problem for IE8. 

Thanks in advance for any help or insight into this.

Brad


asyncError = [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments",  result=2153185281,  more...}
toString()arcgis?v=2.1 (line 14)
constructor(err=[Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...}, _758=undefined)arcgis?v=2.1 (line 48)
err = [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...}
_758 = undefined
toString()arcgis?v=2.1 (line 14)
constructor(_954=undefined, io=undefined, _955=undefined, _956=undefined)arcgis?v=2.1 (line 48)
_954 = undefined
io = undefined
_955 = undefined
_956 = undefined
toString()arcgis?v=2.1 (line 14)
constructor(r=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...}, i=Object { args={...}, url="http://boigiscw02/arcgi...oScript2._jsonpCallback", more...})arcgis?v=2.1 (line 48)
constructor(_1d0=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...}, io=Object { args={...}, url="http://boigiscw02/arcgi...oScript2._jsonpCallback", more...})arcgis?v=2.1 (line 48)
toString(_2b4=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14)
toString()arcgis?v=2.1 (line 14)
toString(_143=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14)
toString(_149=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14)
toString()arcgis?v=2.1 (line 14)
toString(_143=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 14)
toString(_149=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 14)
constructor(dfd=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 48)
toString()arcgis?v=2.1 (line 14)
toString()arcgis?v=2.1 (line 14)
0 Kudos
4 Replies
HemingZhu
Occasional Contributor III
I have a service on a file geodatabase that I query using the javascript API.    The query works fine in IE but fails with NS_ERROR_XPC_NOT_ENOUGH_ARGS on Firefox.  The stack trace from firebug is below.  

A. Anyone else have problems with firefox vs ie using esri.tasks.QueryTask and esri.tasks.Query?
B. How do you debug into dojo so you can see where the problem actually occurs?
C. Any settings or addons that could affect this?

The query is returning polygon geometry for 200-300 features with no problem for IE8. 

Thanks in advance for any help or insight into this.

Brad


asyncError = [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments",  result=2153185281,  more...}
toString()arcgis?v=2.1 (line 14)
constructor(err=[Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...}, _758=undefined)arcgis?v=2.1 (line 48)
err = [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...}
_758 = undefined
toString()arcgis?v=2.1 (line 14)
constructor(_954=undefined, io=undefined, _955=undefined, _956=undefined)arcgis?v=2.1 (line 48)
_954 = undefined
io = undefined
_955 = undefined
_956 = undefined
toString()arcgis?v=2.1 (line 14)
constructor(r=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...}, i=Object { args={...}, url="http://boigiscw02/arcgi...oScript2._jsonpCallback", more...})arcgis?v=2.1 (line 48)
constructor(_1d0=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...}, io=Object { args={...}, url="http://boigiscw02/arcgi...oScript2._jsonpCallback", more...})arcgis?v=2.1 (line 48)
toString(_2b4=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14)
toString()arcgis?v=2.1 (line 14)
toString(_143=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14)
toString(_149=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14)
toString()arcgis?v=2.1 (line 14)
toString(_143=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 14)
toString(_149=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 14)
constructor(dfd=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 48)
toString()arcgis?v=2.1 (line 14)
toString()arcgis?v=2.1 (line 14)


Can you post the code portion on your query. It looks like something is missing on your query definition.
0 Kudos
bradeckrose
New Contributor
myns.queryFacilities = function () {
    var myQueryTask = new esri.tasks.QueryTask(myns.basemapURL + "/" + myns.facilityLayerID.toString() );
    var myQuery = new esri.tasks.Query();

    myQuery.where = "AMS_FacID is not null";
    myQuery.outFields = ['AMS_FacID', 'FAC_NAME'];      //, 'LLat', 'LLong'];
    myQuery.returnGeometry = true;

dojo.connect (myQueryTask, "onComplete", myns.facilityQuerySuccess);
dojo.connect (myQueryTask, "onError", myns.facilityQueryError);
    myQueryTask.execute(myQuery);
};
0 Kudos
HemingZhu
Occasional Contributor III
myns.queryFacilities = function () {
    var myQueryTask = new esri.tasks.QueryTask(myns.basemapURL + "/" + myns.facilityLayerID.toString() );
    var myQuery = new esri.tasks.Query();

    myQuery.where = "AMS_FacID is not null";
    myQuery.outFields = ['AMS_FacID', 'FAC_NAME'];      //, 'LLat', 'LLong'];
    myQuery.returnGeometry = true;

dojo.connect (myQueryTask, "onComplete", myns.facilityQuerySuccess);
dojo.connect (myQueryTask, "onError", myns.facilityQueryError);
    myQueryTask.execute(myQuery);
};


Your code looks OK. Not sure what is wrong. Change your code a little bit and test it. Like myQuery.where = "AMS_FacID >0" (assuming it is a numeric field); Change dojo.connect (myQueryTask, "onComplete", myns.facilityQuerySuccess);
dojo.connect (myQueryTask, "onError", myns.facilityQueryError);
myQueryTask.execute(myQuery); into one statement.  myQueryTask.execute(myQuery, myns.facilityQuerySuccess, myns.facilityQueryError ); Good luck!
0 Kudos
bradeckrose
New Contributor
Finally found the answer.

The "onComplete" callback function was adding the queried features to an HTML select dropdown list.

The add(newoption,beforeoption) method is not browser agnostic.   IE handled the case where I threw it .add(option) and omitted the second argument to add at the end of the list.   Firefox threw an exception and fired the "onError" function of the queryTask.  Firefox wants a null argument.

The final code is:
var addarg = dojo.isIE ? 0 : null;
        dropdown.add(opt, addarg);
0 Kudos