No imaging component suitable to complete this operation was found error

4102
7
09-11-2012 11:39 AM
shaileshgavathe
Occasional Contributor II
We occassinaly get the following error on WPF Client and it crashes application.  We are using ArcGIS Server 10.1 with PNG images as our server tiles from services.

Is there any solution to it?

Would registry changes in the following link help us or we need to look at ArcGIS Server Tiled Services??

http://swimmingpooldotnet.wordpress.com/2010/08/09/wpf-error-no-imaging-component-suitable-to-comple...

at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
   at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions,  BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
   at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
   at System.Windows.Media.Imaging.BitmapImage.EndInit()
   at ESRI.ArcGIS.Client.TiledLayer.tileLoadCompleted(ImageTileInfo data, Stream imgStream, Exception error)
   at ESRI.ArcGIS.Client.TiledLayer.client_DownloadDataCompleted(Object sender, DownloadDataCompletedEventArgs e)
   at System.Net.WebClient.OnDownloadDataCompleted(DownloadDataCompletedEventArgs e)
   at System.Net.WebClient.DownloadDataOperationCompleted(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()


Thanks and Regards,
Shay ~
0 Kudos
7 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

This happens when an image cannot be download for some reason - perhaps a network interruption, service/server interruption, etc. However we've only ever had a few report of this exception and have not been able to reproduce it. I'd really appreciate it if you could use Fiddler to view the requests/responses and post anything related to the error (or alternatively email me on mbranscomb@esri.com).

There is an Error property on the ArcGISTiledMapServiceLayer.TiledLoaded event - you could try handling that event and checking the error property. For more info see http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client~ESRI.ArcGIS.Cli... (ignore the SilverLight info). However, I'm not sure that the event fires in the case of the NotSupportedException you are seeing.

Cheers

Mike
0 Kudos
shaileshgavathe
Occasional Contributor II
Thank you, Mike for suggestions.

We tried handling error in TileLoaded Event. It did not catch an error at that Event but app still crashed. Could that be related ESRI Tile Download API and WPF Cache?

Running Fiddler didn't tell us much either.

Thanks and Regards,
~ Shay
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

So there was no indication of a failed request in Fiddler when the exception occurred?

Which server/service are you using - is it publically accessible?

Cheers

Mike
0 Kudos
shaileshgavathe
Occasional Contributor II
Fiddler didn't have any error on tile loading either. I was hoping, it would display error on tile download with
httpwebrequest. We are using AGS 10.1 with about 100 some services running on the box. Since ESRI stopped multi-layer caching in AGS 10.1, we had to split our multi-layer cache service into multi cache services. This server is internal not accessible publicly. I will try to get more details on error from event log and arcgis server or iis logs will email you to your email id provided.

Thanks and Regards,
Shay~
0 Kudos
LuisGarcia2
Occasional Contributor II
Hi, I was wondering if you guys found the solution to this problem. It happened to me twice today (good thing this application is not in production yet). I am actually already handling the TileLoading event and it did not fire at all. I only had on my map the base layer (which is the one that handles the TileLoading) and a graphics layer which I don't think uses tiles, correct? So my assumption is that it came from the base layer. I had never seen this in more than a year programming with your WPF control until today.
0 Kudos
shaileshgavathe
Occasional Contributor II
Hi, I was wondering if you guys found the solution to this problem. It happened to me twice today (good thing this application is not in production yet). I am actually already handling the TileLoading event and it did not fire at all. I only had on my map the base layer (which is the one that handles the TileLoading) and a graphics layer which I don't think uses tiles, correct? So my assumption is that it came from the base layer. I had never seen this in more than a year programming with your WPF control until today.


Hello Garcia,

I have had tileloading and tileloaded events handled as well. They are in try catch as well. But it didn't really help. What really helped us was when we bumped the memory of ArcGIS Server machine. We also cleaned up caches and recreated the services and cache to avoid any corrupted tiles etc.

Since then, we didn't see any crash related to this event. It seemed to be related to ArcGIS Server performance, network latency and memory on the Server.

If you have resources, you can use ArcGIS Server 10.1 cluster with web adaptor to balance the server load.

Thanks and Regards,
Shay ~
0 Kudos
shaileshgavathe
Occasional Contributor II
To prevent your WPF App from crashing, handle exceptions at
Application.DispatcherUnhandledException

Read this forum,
http://stackoverflow.com/questions/1472498/wpf-global-exception-handler


Thanks and Regards,
Shay ~
0 Kudos