Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

An UCMA 3.0 endpoint application throws an unhandled runtime exception in Lync Server 2010


View products that this article applies to.

Symptoms

Assume that you are developing an application by using Microsoft Lync Server 2010, Unified Communications Managed API 3.0 (UCMA3.0). The UCMA application is creating an application endpoint and a user endpoint. When the endpoint runs for several hours in a Lync Server 2010 environment, the application throws an unhandled runtime exception.

↑ Back to the top


Cause

This issue occurs because of a known bug. The bug is triggered when the user endpoint and application endpoint is created in the same platform that has inband query enabled.

↑ Back to the top


Resolution

To resolve this issue, install the following cumulative update:

2500449 Description of the cumulative update for Lync Server 2010, Unified Communications Managed API 3.0 Runtime: November 2011

↑ Back to the top


Workaround

To work around this issue, use one of the following methods:
  • You can set the ProvisioningDataQueryDisabled property to true. This disables the inband query.
  • Because UCMA is highly asynchronous, exceptions are sometimes thrown from a worker thread.

    When an exception is thrown from a worker thread that is used by UCMA, and the exception is not handled within that worker thread, the exception is not caught. This issue also occurs when the application has a “try or catch” function to handle this type of exception. This issue occurs because the exception occurs in the thread context of the UCMA worker thread instead of the thread context of the user code that is called UCMA.

    In order to handle the exception, UCMA has an Exception handler (the UnhandledExceptionManager class) that can be registered in application code for unhandled exceptions in worker threads.

    The following code example shows how to register an UnhandledThreadPoolException Handler delegate with the UnhandledExceptionManager class by setting the VerifyAndIgnoreUnhandledThreadPoolException property:

    // Configure UnhandledExceptionManager class to log uncaught exceptions
    UnhandledExceptionManager.VerifyAndIgnoreUnhandledThreadPoolException = this.LogAndIgnoreUncaughtExceptions;
    The delegate instance is the LogAndIgnoreUncaughtExceptions method of the calling class.The following code example shows how to ignore the exception after you log it:

    bool LogAndIgnoreUncaughtExceptions(Exception ex, WaitCallback method, Object state)
    {
    System.Diagnostics.Trace.WriteLine(ex.ToString());
    return true;
    }
    Note After registering the event, UCMA will pass all unhandled exceptions from worker threads to this event. This will prevent the application from crashing because of this unhandled exception.

↑ Back to the top


More Information

For more information about the ApplicationEndpoint.ProvisioningDataQueryDisabled property, visit the following Microsoft website:
For more information about the UnhandledExceptionManager class, visit the following Microsoft website:


↑ Back to the top


Keywords: kbqfe, kbsurveynew, kbfix, kbexpertiseadvanced, kb

↑ Back to the top

Article Info
Article ID : 2621839
Revision : 1
Created on : 1/7/2017
Published on : 6/21/2012
Exists online : False
Views : 361