Re: Problem with JNI and Tomcat
- From: "Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 10 Apr 2007 13:56:49 +0100
Elvandar wrote:
The java method sometimes seems to be correctly called (no exceptions
thrown), but the data it retrieves is absolutely incorrect. The problem
is that most of times it is not called, but if I open a serial terminal
all data arrived and bufferized is correctly shown on screen...and if I
run the same DLL in a java standalone app all works correctly, the
problem only happens if I load the DLL under tomcat...
The only possibilities I can think of (that you haven't already ruled out) are
that either the machine is running under a higher load with Tomcat (and so may
be missing asynchronous notifications somewhere), or that the threading
environment is different.
I'm a little bit suspicious of the calls to AttachCurrentThread() and
DetachCurrentThread() in your NotifyEvent(). If that is being called at
serial port speeds, and if I'm right in thinking that AttachCurrentThread() is
a relatively heavyweight operation when the thread is not already attached[*],
then that /might/ a source of problems.
-- chris
[*] AFAIK it involves messing around with the target thread's stack.
.
- References:
- Problem with JNI and Tomcat
- From: Elvandar
- Re: Problem with JNI and Tomcat
- From: Gordon Beaton
- Re: Problem with JNI and Tomcat
- From: Elvandar
- Problem with JNI and Tomcat
- Prev by Date: Java Best practices
- Next by Date: Re: How to find a whether a method is used by particular thread or not?
- Previous by thread: Re: Problem with JNI and Tomcat
- Next by thread: Why are sometimes a particular website referred by multiple URL's
- Index(es):
Relevant Pages
|