0
votes

I am getting an exception (an error in the Application Log) when enabling a receive location as follows:

The Messaging Engine failed to add a receive location "My-Receive-Location" with URL "jms://TestServer:1099/Queue/testQueue/TestClientId/receive/Text" to the adapter "JNBridge JMS". Reason: "The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception.".

My research into the JNBridge JMS adapter suggests that com.jnbridge.jnbcore.ObjectWrapper often wraps a more informative InnerException.

However, there does not seem to be any way for me to catch this Exception when it is thrown.

My best try so far is to enable the Receive Location in code as follows (from http://msdn.microsoft.com/en-us/library/microsoft.biztalk.explorerom.receivelocation(v=bts.20).aspx):

private static void EnumerateReceiveLocations()
{
    BtsCatalogExplorer root = new BtsCatalogExplorer();
    try
    {
        root.ConnectionString = "Server=.;Initial Catalog=BizTalkMgmtDb;Integrated Security=SSPI;";

        //Enumerate the receive locations in each of the receive ports.
        foreach (ReceivePort receivePort in root.ReceivePorts)
        {
            Console.Out.WriteLine(receivePort.Name);
            //Enumerate the receive locations.
            foreach (ReceiveLocation location in
               receivePort.ReceiveLocations)
            {
                Console.Out.WriteLine(location.Name);
                if (location.Name == "My-Receive-Location")
                {
                    location.Enable = true;
                    root.SaveChanges();
                }
            }
        }
        Console.Read();
    }
    catch (Exception e)//If it fails, roll-back all changes.
    {
        throw e;
    }
}

However, this does not throw any exception during execution, and simply raises that same error in the Windows Application Log.

As such, is there any way for me to get further information about an exception thrown during BizTalk receive location enabling?

1

1 Answers

3
votes

How about enabling error logging in the adapter's transport handlers? You can specify a log file name/location and toggle error logging on and off as needed. The error log will contain all nested inner exceptions where you'll find the root cause. Check out the Users' Guide, pg 16 version 2.1. If you are using both send and receive sides of the adapter, configure the error logging in the send and receive transport handlers to point to the same file.

William