473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Async call from ill-mannered SDK

JDK
This may be entirely the wrong forum for this message, but I wanted to give
it a try.

I am creating an ASPX page, with C# code behind, and am calling on a C#
helper class, which in turn is wrapping a lot of functionality from a
vendor's SDK. The SDK (which I have no source for, or visibility into) is
actually Java-based; they wrote a COM (or COM+) wrapper for it long ago, and
more recently created a .NET wrapper for *that*.

I have a number of problems that I'm trying to work through. The most
pressing is one that my program runs perfectly the first time through, but
then the second time I try it (with identical arguments), an exception is
raised to the UI thread (object reference not set to an instance object) and
my UI exits. Meanwhile, in the IIS 6.0 worker process, my method call
continues to work, sending output to my log file till it completes normally.
Of course, when it attempts to return that result to the UI thread, the UI
thread has long since ended. Sort of like a kid who comes back from camp to
find that his parents have moved.

Based on this behavior, I'm postulating that the SDK has made some sort of
asynchronous call to a sister program, and if there's any issue, major or
minor, the async call throws an exception, which goes for the UI thread,
rather than being caught in my local try/catch.

Any later calls to my program (which go to the SDK and in turn, to the JVM
hanging around in the IIS worker process) seem pretty much hosed as well,
throwing either the same "object reference not set to an instance object"
error, or (more interestingly) a
"org.apache.xerces.jaxp.DocumentBuilderFactory Impl not found" error, even
though this class is most definitely on the classpath. The error information
coming back seems very limited (Message and StackTrace from the exceptions
have little useful content...I'm wondering if all the useful stuff was
stripped out in one of the numerous wrappers).

Restarting IIS gets rid of the errors, and allows me one error-free run of
the program. However, restarting IIS after each request doesn't seem like a
viable strategy.

My questions would be:

(1) Is there any way to divert any potential async errors from the UI thread
to (for example) the NET equivalent of /dev/null? Or better still, disable
any async calls?
(2) More broadly, are there any best practices for isolating an
ill-mannered, untrustworthy SDK?
(3) How would you deal with a problem such as the one described above?
Tracking down the original developer of the SDK and smacking him on the head
with a cast-iron skillet might be satisfying, but seems to do little to
solve my problem.

I'm not going to name the vendor, even though it's a totally crappy product,
and, has proven to be supported in name only (the engineers/developers
appear to be refusing to answer any queries from front-line support, even
after several weeks).

Thanks very much for any assistance or suggestions you might offer!
JDK

Nov 16 '05 #1
0 1248

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Vanessa | last post by:
I have a question regarding async mode for calling Microsoft.XMLHTTP object. Microsoft.XMLHTTP hangs the IE once in a while suddenly, but it will work again after half an hour or so without doing...
2
by: Tom Vandeplas | last post by:
Hi all, When using an asynchronous API call (in my case WriteFileEx) in a thread it seems to become blocking instead of non-blocking (see details below). Can somebody explain me what is...
6
by: Amy L. | last post by:
I am working on a project where I will have a ton of async DNS calls in a console application. I would like to process the results of the Aync calls on the same thread that made the async call. ...
10
by: Shawn Meyer | last post by:
Hello - I am trying to write a class that has an async BeginX and EndX, plus the regular X syncronous method. Delegates seemed like the way to go, however, I still am having problems getting...
8
by: TS | last post by:
Im in a web page and call an asynchronous method in business class. the call back method is in the web page. When page processes, it runs thru code begins invoking the method then the page...
6
by: Shak | last post by:
Hi all, Three questions really: 1) The async call to the networkstream's endread() (or even endxxx() in general) blocks. Async calls are made on the threadpool - aren't we advised not to...
7
by: Shak | last post by:
Hi all, I'm trying to write a thread-safe async method to send a message of the form (type)(contents). My model is as follows: private void SendMessage(int type, string message) { //lets...
11
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling...
10
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under...
0
by: Paul Hadfield | last post by:
Hi, From reading various articles on scalability issues, I understand that there is only a finite number of ASP.NET worker threads and any long running task within ASP.NET should be fired off on...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.