|
Home > Archive > BizTalk Server Applications Integration > April 2005 > Object reference not set to an instance of an object.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Object reference not set to an instance of an object.
|
|
| Abel Chan 2005-04-26, 2:48 am |
| Hi there,
I created a simple AIC with the .NET toolkit. I was able to register in
COM+ with regsvcs and things doing OK on BizTalk 2002 until I deploy it to a
test box.
When happened was if I drop multiple documents at the same time (drop 10
documents within one second), it only process some of them (the first 3) and
the rest give me the following error message.
I am not sure whether it is a COM+ configuration issue or the AIC coding
issue. In the code, I was trying to post a document to a Web Services and
each document posting takes about 10 to 15 seconds. If I remove the web
service call, it won’t give me any error. So some how there is an object
instantiation or even threading issue. Any thing that I need to know about
calling Web services from the AIC?
I saw someone posting a similar issue at
http://www.talkaboutsoftware.com/gr...sages/4458.html
but I already have SP4 installed so that wouldn't work. Could you please
help? Thanks.
Event Type: Error
Event Source: BizTalk Server
Event Category: Document Processing
Event ID: 324
Date: 4/25/2005
Time: 3:18:03 PM
User: N/A
Computer: BELDISP2
Description:
An error occurred in BizTalk Server.
Details:
------------------------------
[0x80004003] Object reference not set to an instance of an object.
[0x0159] The server encountered a transport error while processing the
messaging port "prtSetAncillaryServicesReceive", which uses a transport
component with a ProgID of "MyAIC.NET.AncillaryServicesBizTalkA".
[0x012a] All retry transmissions failed.
[0x80004003] Invalid pointer
[0x0156] The server could not finish processing messaging port
"prtSetAncillaryServicesReceive".
[0x1730] Suspended Queue ID: "{B9A5791F-4A67-459C-A3FA-7002F072525C}"
[0x80004003] Invalid pointer
| |
| WenJun Zhang[msft] 2005-04-26, 7:47 am |
| Hi Abel,
Yes, my first thought is also that the problem may be threading model
related. Do you make sure that the AIC is implemented as MTA instead
of STA? Please pay attention that wrapping STA components into COM+
to be hosted as MTA(pooled) still doesn't help with a long processing
scenario like yours i.e submitting documents to web service. In this
kind of cases, building MTA is the only solution.
The following articles highlight this topic:
Performance limitations of BizTalk Application Integration Components
that are written in Visual Basic
http://support.microsoft.com/?id=327323
Slow Performance of Application Integration Components That Are
Written in Visual Basic
http://support.microsoft.com/?id=291670
Hope the info helps. Also glad to notice the tough .net tool kit
issue has been resolved finally. :-)
Best regards,
WenJun Zhang
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
========================================
=============
Business-Critical Phone Support (BCPS) provides you with technical
phone support at no charge during critical LAN outages or "business
down" situations. This benefit is available 24 hours a day, 7 days a
week to all Microsoft technology partners in the United States and
Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/te...rtoverview/4001
0469
Others:
https://partner.microsoft.com/US/te...upportoverview/
If you are outside the United States, please visit our International
Support page: http://support.microsoft.com/common/international.aspx
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no
rights.
| |
| Abel Chan 2005-04-26, 5:49 pm |
| Hi WenJun,
Thanks to your quick response. 
I read the two articles. But they are targeting VB6.
The AIC is written in VB.NET and I use the .NET Toolkit so it
1) Inherits ServicedComponent
2) Implements IBTSAppIntegration
I think the first article points out the issue. The AIC logic is very
simple. It is trying to post a SOAP request to a Web Service and wait for
the response. It is a synchronize call or a blocking call and I have
extracted the code below.
The MyWebRequest.GetResponse() can return as fast as 10 seconds or as long
as two minutes. Did I make some mistake in the sample code?
According to the first article, I need to code the AIC as free threaded
component in C++ ATL or VB.NET. The AIC is written in VB.NET. What do I
need to do to make it free threaded? Any sample code to target a similar
situation like what this?
Thanks so much WenJun. BTW, I have BTS 2002 and .NET toolkit.
Sample code below:
Dim MyWebRequest As System.NET.WebRequest
Dim MyIOStream As System.IO.Stream
Dim MyWebResponse As System.NET.WebResponse
Dim MyXMLDoc As New XmlDocument
Dim MySoapData As String = MyXMLDoc.OuterXml
MyXMLDoc.LoadXml(v_xmlData)
MySoapData = MyXMLDoc.OuterXml
MyWebRequest = System.Net.WebRequest.Create(v_AncillaryURL)
'Setup request parameters
MyWebRequest.ContentType = "text/xml"
MyWebRequest.Method = "POST"
MyWebRequest.ContentLength = MySoapData.Length
MyWebRequest.Timeout = v_ServerTimeOut
'Wrtie to stream
Dim SoapDataInBytes As Byte() =
System.Text.Encoding.ASCII.GetBytes(MySoapData)
MyIOStream = MyWebRequest.GetRequestStream()
MyIOStream.Write(SoapDataInBytes, 0, MySoapData.Length)
MyIOStream.Flush()
'Get the response from remote site
MyWebResponse = MyWebRequest.GetResponse()
.......
Abel Chan
| |
| WenJun Zhang[msft] 2005-04-27, 7:55 am |
| Hi Abel,
You are right there is not STA/MTA for .net components. However I
assume the problem does have relationship with the web service call
but the bottleneck may be at client side. As I know, any .net http
client components(like HttpWebRequest) have the same behavior as IE:
only 2 connections are allowed per process, subsequent requests will
not issue new connections but will be queued until the previous
processing is finished. This may explain why you see only 2 - 3
documents are got processed every time.
I think you may create a new test AIC which doesn't make the web
service call but sleep 10 - 15 secs or more instead. If it doesn't
meet the same problem, we can confirm the issue is on the web service
call then.
Thanks.
Best regards,
WenJun Zhang
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
|
|
|
|
|