We have a single-page MVC application containing three map instances. We intermittently encounter "Object reference not set to an instance of an object" exceptions being thrown on the production server by calls to bg_GeoResource.axd to get the background image. None of the maps have a background image set but instead are just using the default background image. This is the stack trace:
Stack Trace: at 8hM=.dxQ=.fBQ=(HttpContext fRQ=)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
In attempting to reproduce the problem we found that the background images loaded correctly during initial loading of the maps.
Calls to bg_GeoResource.axd intermittently cause null-reference exception
Hi Chuck,
Sorry we can’t recreate the issue in our end, would you please build a small sample for us to debug? or take a video to show the issue?
Not sure but might be worth to have a try that you can remove the map defined codes from view to the controller and then have a try? as one of our customer have a similar map null issue intermittently and avoid the issue after do that.
Thanks,
Troy
We’ve not been able to recreate the issue either, but it continues to happen intermittently on the production server even after removing everything from the view other than .Render(). We only know this from the application’s event log and have not been able to observe the behavior directly. We tried setting MapBackground.Visible = false but the td element that contains the map still has a background-image style that points to a transparent background tile pulled from bg_GeResource.axd.
Since adding more logging detail a couple days ago we’ve noticed that all errors since then are occurring for the following two user agents:
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
I think these map to IE6 and IE8 on Windows XP. Are you able to test the map with similar OS/browser versions? (And is IE6 even supported??)
Hi Chuck,
We enhanced the method that throws the exception. Also, we added some specific exception message to help us to locate the exactly reason why throws this exception. Hope you could try today’s version 7.0.234.0 and try to recreate this issue on your end. If you get the exception again, please send us the message again so that we can continue to track the issue.
Thanks,
Howard
Hi,
I had the same issue! Do create the map inside controller do not use views!!! I was getting a null map when the Ajax call was executed. Having map defined inside model/controller works way much better and from my point of view provide a greater control.
Hi JM,
Is it possible to show your demo code here? also can you let me know what’s your development environment, you know it’s hard for us to reproduce the problem, what we can do is do some enhancements here to catch the possible exception,but actually, we haven’t catched it.
Best Regards,
Johnny
Hi,
I do not have a specific demo to show but it is just the fact that not using the view to customize the map control did fix the error with the map null object linked with Ajax call to the server methods .
Hi JM,
I’m not sure whether you means the issue that we talked in a ticket thread before, it’s not a occasional exception for us, it’s really hard to recreate it, if it’s another one, can you shown more details here?
Thanks,
Johnny