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

Discussion in 'Java' started by Storm, Sep 6, 2004.

  1. Storm

    Storm Guest

    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.
     
    Storm, Sep 6, 2004
    #1
    1. Advertising

  2. Storm

    simon hogg Guest

    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.

    (Storm) wrote in message news:<>...
    > 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.
     
    simon hogg, Oct 4, 2004
    #2
    1. Advertising

  3. Storm

    Storm Guest

    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
     
    Storm, Oct 16, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bart59
    Replies:
    0
    Views:
    405
    bart59
    Jun 9, 2004
  2. Roedy Green

    JDK 1.4..2_05 is ready

    Roedy Green, Jul 5, 2004, in forum: Java
    Replies:
    2
    Views:
    2,401
    Roedy Green
    Jul 5, 2004
  3. Jan Persson
    Replies:
    0
    Views:
    461
    Jan Persson
    Aug 18, 2004
  4. bart59
    Replies:
    1
    Views:
    484
    Prateek R Karandikar
    Jun 9, 2004
  5. Replies:
    5
    Views:
    270
    Olivier Renaud
    Mar 15, 2007
Loading...

Share This Page