NullReferenceException is thrown sometimes by one or several rest map services

421
3
06-16-2010 06:06 AM
VasylMelnychuk
New Contributor
Hello,

I have developed Silverlight application which uses 4 rest map services.
When application starts to intialize these four layers (ArcGISDynamicMapServiceLayer), sometimes one or two of them are failed to initialize.
However after next initialization - everything is fine.
This always happens after IIS (which hosts ArcGIS Rest) and ArcGIS Server Object Manager services are restarted. Also after map services were idle for long period of time.

Response for failed layer:
{"error":{"code":500,"message":"Server Error - Object reference not set to an instance of an object.","details":[]}}


Rest log:
Log Entry : 16.06.2010 14:46:01
  INFO:Handling REST request
  http://server/ArcGIS/rest/services/Sattelite/MapServer?f=json
-------------------------------

Log Entry : 16.06.2010 14:46:01
  INFO:Handling REST request
  http://server/ArcGIS/rest/services/AC/Address/MapServer?f=json
-------------------------------

Log Entry : 16.06.2010 14:46:01
  INFO:Handling REST request
  http://server/ArcGIS/rest/services/BaseMap/MapServer?f=json
-------------------------------

Log Entry : 16.06.2010 14:46:01
  INFO:Handling REST request
  http://server/ArcGIS/rest/services/SLCC/CAD/MapServer?f=json
-------------------------------

Log Entry : 16.06.2010 14:46:01
  ERROR:Object reference not set to an instance of an object. ::    at ESRI.ArcGIS.REST.RequestHandler.ProcessRequest()
   at ESRI.ArcGIS.REST.RestHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
  http://server/ArcGIS/rest/services/AC/Address/MapServer?f=json
-------------------------------

I use:
ArcGIS Server 9.3.1 (SP1), security is not enabled for services.

Is there any solution for this problem?

Thanks,
Vasyl Melnychuk
0 Kudos
3 Replies
RichardWatson
Frequent Contributor
I haven't a clue as to what the underlying issue might be.  That said, you can attach the debugger to the ArcSOC process(es) and see what is going on.  If you use Visual Studio then just tell it to stop when a NullReferenceException is thrown.  When you catch it, you can (using ESRI and Microsoft debug symbols) see what was going on.  Since it is a .NET exception you can use the SOS debugging in Visual Studio in order to dive into the managed code.
0 Kudos
RaviNarayanan
Esri Contributor
This sounds related to NIM047825 which has been fixed in 10.0. Please contact ESRI Support to verify if this is indeed a  related issue.

A workaround solution might be to periodically ping the services probably using some script simlar to the python script that is listed in this blog that will access each of the services http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/08/12/The-REST-API-cache.aspx


Thanks
Ravi
0 Kudos
VasylMelnychuk
New Contributor
Thanks, Ravi

I'll contact support.

Regards,
Vasyl
0 Kudos