Santosh Benjamin's Weblog

Adventures with AppFabric, BizTalk & Clouds

The Adapter Diaries – Oracle Adapter – 3

leave a comment »


Strange Errors and workarounds

So, after a while, i’m back to the series. I got called out to help with another project for a few weeks so there wasnt much to write about in this space. Anyway, i’m back to the Oracle adapter project and immediately came face to face with some strange error messages and some solutions that i obtained after  much trawling through posts and search results. Here are the key issues i faced. I hope this helps you if you get the same kind of errors.

(1) PersistenceException

Excerpt from the event log

Exception thrown from: segment 1, progress 18
Inner exception: Exception occurred when persisting state to the database.
       
Exception type: PersistenceException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void Commit()
The following is a stack trace that identifies the location where the exception occured

   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.Commit()  (etc etc)

Additional error information:

        A batch item failed persistence Item-ID 091955b1-b0a4-4c2c-ad51-1739d516ce82 OperationType MAIO_CommitBatch Status -1061151998 ErrorInfo The published message could not be routed because no subscribers were found. .
       
Exception type: PersistenceItemException
Additional error information:

        Failed to publish (send) a message in the batch. This is usually because there is no one expecting to receive this message.  The error was The published message could not be routed because no subscribers were found.  with status -1061151998.
       
Exception type: PublishMessageException

Reason :  I was publishing a message from one orchestration intending it to be consumed by another. I preferred the message box route instead of partner orchestrations for a looser coupling.  The problem was a small typo in the BTS.MessageType filter of the consuming orchestration. Fixed that and all was well.

Other Links

Todd Uhl got a similar error and posted about it here.

(2) Unable to load DLL (BAUtil.dll)

Excerpt from the event log

Event Type: Error
Event Source: Microsoft BizTalk Adapters for Enterprise Applications
Event Category: None
Event ID: 0
Description:
Runtime Error: Unable to load DLL (BAUtil.dll). 

(and also other messages like : “RuntimeAgent: Error trapped in constructor: No connection could be made because the target machine actively refused it)

Reason: This is a known issue. There is a Support article here that talks about it. This issue occurs if the domain user account that is configured as the BizTalk host instance cannot read the following registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\BizTalkAdapters\Config.

When i first did my POCs with the adapter on my local machine, I had the biztalk account as a local admin. (Yeah, i know.. we shouldnt do stuff like that… but thats a legacy from the 2004 days when i tore my hair out trying to set the minimum permissions for the various accounts. IMO, developing with Least User Privelege is nice but only in theory :-). Anyway, on the ‘real’ dev system, the biztalk account is a network user and that needed to have the permissions to the specified key.

(3) Calling a webservice: The request was aborted: The request was canceled

Excerpt from the event log

WebException: The request was aborted: The request was canceled”

Reason and Solution:

It appears that this is to do with connection Timeout mismatch on client and proxy.In my solution, i need to call a Java webservice via a custom proxy (invoked in an expression shape). Under even small loads (e.g 15 simutaneous requests) i got this error showing up and those messages got suspended. I ended up losing on average about 25% of the messages in every batch. Looking through the post from Richard Seroter and one on the MSDN forums led me to track down the issue to the HTTP connections and KeepAlive Issues. As i had not done any changes to my machine.config (so the timeout stayed at the default 90 seconds) , i decided to poke into the Tomcat webserver on the other end of the solution and the MSDN forum post led me to the Tomcat server.xml config file. (The last reply on the MSDN forums shows an excerpt from the Tomcat log)

 <!– Define a non-SSL HTTP/1.1 Connector on port 8080 –>

<!– The port and connectionTimeout was changed from the default. The connectionTimeout is set to 110 seconds to be greater than .Net 2.0 framework of 100 seconds for HTTP Keep Alives –>

<Connector port=”8000″ maxHttpHeaderSize=”8192″

maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″

enableLookups=”false” redirectPort=”8443″ acceptCount=”100″

connectionTimeout=”110000″ disableUploadTimeout=”true” />

In our server the connectionTimeout had been set to 2000. Once i changed it to the value shown here, the system didnt lose any more messages. I guess i had better test it with much larger batches just to be safe.

(4) AmbiguousXPathExceptions

This was an interesting one. The system that was working seemingly smoothly suddenly threw this message indicating that there was an error in promoting a specified property in a message obtained from mapping a response from the webservice i talked about above. I knew it had to be something to do with the data since the earlier tests were all fine. It was a simple mistake in a map. In my source schema, a particular element (call it EventID) is part of a repeating group. In my target i was only interested in one EventID but had linked the nodes directly. So when the map encountered a source with 2 events, it created two nodes of my target schema which contained the promoted property and hence the error. I fixed this by using an Index Functoid to pick only the first element.

(5) bts_UpdateMsgbox_BizTalkServerApplication Deadlocks

Excerpt from the event log

The following stored procedure call failed: ”
{ call [dbo].[bts_UpdateMsgbox_BizTalkServerApplication]( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}”.
SQL Server returned error string: “Transaction (Process ID 59) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.”.

Solutions

This one i couldnt solve. There’s a post here that talks about the issue. I suspect its due to my development VM running out of memory occasionally. I will keep an eye on it when i deploy to DEV and beyond and hopefully its only a transient situation.

So, thats it for the weird errors and solutions for all but one.

Advertisements

Written by santoshbenjamin

May 26, 2008 at 11:04 PM

Posted in BizTalk

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: