Closed Bug 197783 Opened 22 years ago Closed 21 years ago

Can not get the reference of JavaApplet function when the browser first starts up

Categories

(Core Graveyard :: Java: OJI, defect)

Sun
SunOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 115998

People

(Reporter: mlgao, Assigned: yuanyi21)

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4a) Gecko/20030316 Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4a) Gecko/20030316 Solaris 8 with the expected patches. When the browser first loads a web page with java applet, the javascript can not get the reference of the JavaApplet's function, such the javascript can not call functions of JavaApplet. Press "Reload" button of the browser, the problem disappear. Go to another page then come back also make the problem disappeared. I attach the necessary files to reproduce the problem. Reproducible: Always Steps to Reproduce: 1.Extract the attachment, put them in a web server. 2.If you have open the mozilla browser, close it. 3.Startup the mozilla browser. 4.Visit the TLiveConnect.html in the attachment. 5.Open the Java Console. After the applet starts, there will be messages in the console. 6. Click on the "Call Java Applet" button, there is a message showing that the reference of the java applet's function can not be retrieved. 7. Reload the page. ( Or leave this page, and then come back to this page) 8. Replace Step 6, the Java console will display: TLiveConnectApplet[LCApplet]: CallFromJavaScript(oLCApplet) It means that JavaScript successfully called JavaApplet function.
Attachment #117458 - Attachment is obsolete: true
It is a gz file.
The problem does not exist on Mozilla for Windows 9X/NT/2000. Seems it only occurs on Solaris platform. I have tested Mozilla Release 1.0, 1.1b, 1.02, 1.3.1b and the nightly build on 03/16 on Solaris 8 and 9 with Java Plugin 1.4.0_01. The problem exists on all versions. My work is depending on the LiveConnect of Mozilla for Solaris, so I am in a hurry. Thanks.
reproduced and investigating!
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
problem about onload trigger.
This is the simplified sample to demonstrate the problem. When the page is loaded, the JavaScript on onload event will automatically try to call the Java Function, and report the result using alert(). There is a button, pressing it also let JavaScript call JavaFunction. The result is: When the browser is just startup and enter the page, the first call will fail. Then everything works fine. It seems it is the problem of onload event trigger.
This is also JPI 's bug. It works well on Windows.
The problem is somehow because onload handler does not work as expected in Unix platform (at least Solaris). This can be proved by setting a breakpoint at nsJVMManager ::WrapJavaObject function when the page gets loaded. The function never gets called. Which means it never gets that far to hold a jobject representing the underlying Java applet object so that liveconnect module can call java to get the interested methods executed. From above, it is a Mozilla browser bug. Please find the right module to get this bug fixed.
->kyle
Assignee: joshua.xia → kyle.yuan
Status: ASSIGNED → NEW
This could be caused by the different architecture of java plugin module on Windows & UNIX. On UNIX, I noticed that the applet is not fully loaded when the onload get called. So js can't get any properties of the applet at that time.
yes, there is a dup - bug 115998. BTW, using a setTimeout here will work around this issue: <BODY onload='setTimeout("oLC.vfnCallApplet()", 1000)'> *** This bug has been marked as a duplicate of 115998 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
This has been fixed in JRE 1.5 release. JRE 1.5 will be released sometimes next year.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: