JDK-6632668 : FF3: Calls to java APIs directly is not working under all scenarios
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-11-21
  • Updated: 2010-11-03
  • Resolved: 2008-01-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b09Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
On Firefox and mozilla based browsers JavaScript can make direct calls to Java APIs e.g.  java.lang.System.out.println can be used to display a message on the Java Console.
This functionality is not working on FF3 while it works on all of the previous versions of
the mozilla family.
Try running the testcases from the following page with FF3 and older versions of the mozilla and FF family.
http://sqeweb/deployment2/jitu/deployment_JDK7_int_ws/deployment/src/plugin/manual/html/DirectTest.html

On FF3 following is the behavior using old and new Plug-in
Old Plug-in
-----------
Boolen tests:
None of the testcases works

Char Tests:
None of the testcases works

Enumeration test:
Half of them work

Numeric tests : All Passed

Null tests : ALL Passed

Other Java APIs(java.awt, java.lang and javax.swing) : All PASSED

New PLug-in:
-----------
Boolen tests:
Some of the testcases works

Char Tests:
NOne of them worked

Enumeration test: All PASSED

Numeric tests : Some of the tests FAILED

Null tests : ALL Passed

Java APIs(java.awt, java.lang and javax.swing) :
Some of them FAILED
Javascript errors of following type is getting thrown while calling the java APIs
Error: uncaught exception: Error calling method on NPObject! [plugin exception: java.lang.IllegalArgumentException: More than one method matching name java.util.Date and arguments [java.lang.Integer]].

Comments
EVALUATION This set of test cases from SQE uncovered several problems: - Needed to keep track of whether a Java method called from JavaScript returns a primitive value (int) or a boxing object (Integer) and return it appropriately to the JavaScript engine. - Needed to return Java Strings as opaque objects to the JavaScript interpreter. However, result of toString() must be returned as a pure JavaScript string. - Needed more precise costs for argument conversion when resolving overloaded Java methods, particularly in inheritance situations: new JDialog(new JFrame) should match JDialog(Frame) rather than JDialog(Window), and should not be ambiguous. - Arbitrary argument -> String conversion needed a higher cost than normal conversions. - Race condition in notification of LiveConnect support that applet has started. - In Mozilla plugin, worked around browser bugs in handling of 32-bit integer values by promoting some values to doubles when passing them to the JavaScript engine. - In IE plugin, reverted to older plugin's code for passing Java longs to the JavaScript engine, and changed how null Java values are passed to JavaScript. - For performance reasons, needed to avoid excessive failed class lookups when walking the Java class hierarchy. - Improved debugging output. Incorporated an automated subset of SQE's LiveConnect regression tests into the code base. Made these tests more robust in the face of failures like JavaScript exceptions being thrown. Added some boundary value tests and simple API tests illustrating earlier problems to this set of tests. Modified these test cases to work with both Firefox and IE given the new plug-in's support for the "java", "Packages", and "new" keywords in the IE JavaScript engine. Tested with these tests as well as several applets including Iris and the Pogo games.
27-11-2007

SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6632668.1 testcase: http://web-east.east.sun.com/deployment/www/tests/1.6.0_10/6632668/
27-11-2007