JDK-6510434 : Javascript to Java callback doesn't work
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_nevada
  • CPU: x86
  • Submitted: 2007-01-07
  • Updated: 2011-03-15
  • Resolved: 2011-03-15
Related Reports
Relates :  
Relates :  
Description
The bug is related to the mozilla bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=338905.

In file deploy/src/plugin/solaris/nscore/JSObject.cpp, there is a
comment snippet in line 265:
    /*
     * when JSObject is GCed after plugin is destroyed, inst is NULL
     * and code is JAVA_PLUGIN_JNIJS_FINALIZE. In this case, we still
     * need consume message from spontaneous pipe and ask browser to
     * release native JSObject,  or spontaneous pipe will be corrupted
     * and resource leak
     */
The comment's idea is that, if code isn't JAVA_PLUGIN_JNIJS_FINALIZE, the function should go on handling the following message instead of consuming the message and return.

But the real code conflicts with this comment:
267:    if (code != JAVA_PLUGIN_JNIJS_FINALIZE) {

        if (inst == NULL || inst->IsDestroyPending()) {

            // Consume the message
            int raw_msg_len;
    ......

I think that we should change the line 267 to "if (code == JAVA_PLUGIN_JNIJS_FINALIZE) {". The test case for bug 338905 can run correctly with the change applies.

Comments
EVALUATION Old plugin specific issue. We are not developing it actively anymore.
15-03-2011

SUGGESTED FIX This scenario had been fixed and works in new plugin(both NPAPI and ActiveX for IE). Since OJI plugin is obsolete and major browsers had dropped support for that, recommendation is to close the bug as will not fix.
18-02-2011

EVALUATION The test case had errors preventing it from working as expected with the new Java Plug-In. The original Bugzilla report has been updated with a revised version of the test case which passes with the new Java Plug-In.
29-11-2007

EVALUATION I can be able to reproduced the problem on both Windows and Solaris platform with OJI plugin and new plugin. IMO, it is more important to fix this problem in the new plugin, which we hope will replace the OJI plugin. Fix for Solaris side for OJI is quite simple as indicated by Alfred. However, fix for Windows OJI is quite involving as it touches the applet lifecycle. I may go ahead fixing the Solaris side of OJI to get some users happy. However, the fixes for new plugin (both solaris and windows) and OJI windows are still under investigation. Will keep this CR deferred to 7 for now.
29-11-2007