Select to view content in your preferred language

FindTask returns "Object reference not set to an instance of an object"

1207
12
Jump to solution
09-05-2012 06:39 AM
JeremyCoulson
Occasional Contributor
Hello.  We have a project for which this example seems to be an excellent starting place: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_map.html

So far, we have made revisions in an attempt to include our data.  This is at http://www.co.frederick.va.us/dev/maps/test4.html.  Instead of the stuff in the example, we are trying to search for a field in our data called RECNUM.  Our data are in this service: http://gis.co.frederick.va.us/ArcGIS/rest/services/Values_PF/MapServer/1

We currently are getting this error when trying to execute a search:

dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"error":{"code":500,"message":"Object reference not set to an instance of an object.","details":[]}});


I'm totally unsure of what is happening.  When I change the findParams.layerIds from 1 to 0, I just get empty data instead of an error result. 

dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"results":[]});


findParams.layerIds = [1]; // 0 returns empty result.  1 returns Object reference not set to an instance of an object. findParams.searchFields = ["RECNUM"];


I'm kind of lost on how to proceed, so I'll be deeply grateful for any assistance.  Thanks!

Jeremy
0 Kudos
12 Replies
JeremyCoulson
Occasional Contributor
Okay, I'm finally back here.  I spent some time on the phone with a couple of ESRI brains and this is what we came up with: Our ArcGis Desktop which created the MXD and published the service was a different version than our ArcGis Server -- 9.3 on Desktop and 9.3 sp 1 on Server.  So, we updated Desktop to the same version, republished the map service, and now it searches.  Whew!

Thanks for your help.  As I'm new to the ESRI world, I think that is one I would not have found on my own.

Jeremy
0 Kudos
JohnGravois
Deactivated User
props to jesvin. 🙂
0 Kudos
__Rich_
Deactivated User
9.3 on Desktop and 9.3 sp 1 on Server

That's a nasty one, glad you found the answer 🙂

If had been the other way around it might have been more obvious but a lack of backwards compatibility is more unexpected!
0 Kudos