[Advanced Java/Gurus] JNI/Win32 hWnd JDK 1.4.2_05 freeze on Javascript Callback

S

Storm

Dear Colleagues,

An advanced Java (i.e.: SUN Java Plugin 1.4.2_05) issue would require
your expertise. Inside a "JRE/1.4.2_05" environment (i.e.: version
prior to that latest installment are performing with an adequate
satisfaction) the execution of an "Applet", acquiring native methods
through a "JNI/Win32" interface and returning data using the
"jaws.jar", (i.e.: JSObject callback to "Javascript") hangs on the
"callback" invocation. (i.e.: it is happening in a "single threaded"
environment)

Please note that the invoked "Java" routine is not returning (i.e.:
the "JavaScript/Jdirect" call happens just before), as well as the
"JavaScript" callback is not being entered.

As remarkable as it could be, to unblock the "Java" runtime main
thread, one would right click on the "Internet Explorer" window (i.e.:
right in the task bar). Consequently the execution of the process
continues.

I have explored numerous options including "Thread" notifications,
garbage collections and method finalizations without success. Finally,
the option of duplication the "hWnd"
based "Win32" messaging flow stood as my ultimate option. I have
finally managed to retrieve the top level "hWnd" handle from my
"JDK1.4.2_05/Win32" environment, not to say easily…; and declared
method such as "SendMessage", "SetFocus", "SetEnabled" (i.e.: and so
on) to replicate the behavior of my "right click". Through the "Spy++"
delivered messaged I, unfortunately, had no chance to discover the
message (i.e.: or the sequence) that had unblocked my process.

Please note that these "JNI/Win32" calls are executed inside a
separate thread, which is not blocked by the "main/thread" freeze.

Finally, I am relying on your wisdom and experience to win that quite
complicated case, unless an upcoming release of the "SUN/JRE" would
correct that damned state of things.

Thank you for your time; and please do not hesitate to come back for
details.
 
S

simon hogg

Did you have any luck with this one? Sun introduced this bug in JDK
1.4.2_04. I logged it as

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5046268

my bug is apparently a copy of

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5048672

There also seems to be more info in one of the other bugs recorded as
a duplicate,

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5031359

The really annoying thing is that I've reported this bug so many
times, with different test cases, and the guys at Sun don't seem to be
taking it very seriously. It's still present (albeit harder to
reproduce; they seem to have tried to fix it but have done a botched
job) in the final release of JDK 1.5.0, which is really disturbing
because we probably won't see a patch release for a while now.

Funnily enough, I'd been trying the same stuff you've mentioned here,
including (without too much luck) the approach of using spy++ on the
ie window.

Have you found a workaround yet?

cheers,

simon.
 
S

Storm

Simon,

First of all, thank you for your post. It has been a pleasure not to
feel alone. Unfortunately a work around was not found, and in my case,
I had to turn to an alternate design principle. If you desire it, I
could send you snippets relative to the 'hWnd' part. You could then be
lucky to find the right sequence of events.


Andrei Chiriaev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top