Calls to JavaScript method from a Java Applet are failing with a No such method error - by RCGoforth

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


ID 620646 Comments
Status Closed Workarounds
Type Bug Repros 6
Opened 11/10/2010 10:49:10 AM
Access Restriction Public

Description


In prior versions of IE and in Firefox, I am able to call methodFoo in JavaScript from my Java Applet running on the same page. In IE9, this no longer works.

My Java Applet contains


  import netscape.javascript.JSObject;
  ...
  private transient JSObject jso;
  ...
  public void init() {
    ...
    jso = JSObject.getWindow(this);
    jso.call("methodFoo", object_to_pass);
    ... }
   


 My Html page contains

 ...
  <object style="height: 1px;width: 650px;" classid = "clsid:CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA" codebase = "http://java.sun.com/update/1.6.0/jinstall-6u11-windows-i586.cab#Version=6,0,0,11" id="AppletControl">
   <param name="java_arguments" value="-Xmx256m" />
   <param name = "CODE" value = "com.namespace.Applet.class" />
   <param name = "archive" value = "./lib/applet.jar" />
   <param name = "type" value = "application/x-java-applet;version=1.6" />
   <param name = "scriptable" value="true" />
   <param name = "mayscript" value="true" />
  </object>
  ...
  <script type="text/JavaScript" src="js/script.js"></script>
  ...



 and script.js contains

  function methodFoo(object_to_pass){	  
    //doStuff
	}


The Exception received from jso.call is 
 
 netscape.javascript.JSException: No such method "methodFoo" on JavaScript object

Sign in to post a comment.
Posted by Bhasker [MSFT] on 2/22/2011 at 3:05 PM
Thank you for your feedback.

This issue was resolved in Internet Explorer 9 RC and the Platform Preview Build released on 2/10/2011. Please verify the change and file a new feedback (or reactivate the existing one) if the problem persists.

Best regards,

The Internet Explorer Team
Posted by Bhasker [MSFT] on 1/26/2011 at 9:33 AM
Thank you for the URL.

We were able to reproduce the issue and are investigating it.

Best regards,

The Internet Explorer Team
Posted by IECustomizer on 1/25/2011 at 4:17 PM
MSFT - see also this forum thread...

http://social.msdn.microsoft.com/Forums/en/iewebdevelopment/thread/21950d64-9c91-460d-870e-d2a84cc7357c
Posted by fghfghfghfgh on 1/7/2011 at 9:44 AM
This is reproducible, example at http://www.raditha.com/java/mayscript.php

Any calls to JavaScript from a Java Applet fail in IE 9 with “No Such Method”,
netscape.javascript.JSException: No such method "updateWebPage" on JavaScript object
    at sun.plugin2.main.client.MessagePassingJSObject.newJSException(Unknown Source)
    at sun.plugin2.main.client.MessagePassingJSObject.waitForReply(Unknown Source)
    at sun.plugin2.main.client.MessagePassingJSObject.call(Unknown Source)
    at com.raditha.articles.JSHelloWorld3$1.actionPerformed(JSHelloWorld3.java:31)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Posted by Bhasker [MSFT] on 12/28/2010 at 5:15 PM
Thank you for your feedback.

There is insufficient information to reproduce the behavior you are observing. Please provide us with a sample page (including applet) or URL to reproduce this issue. If your issue is same as Connect Feedback #624397, please follow the progress of this bug there.

We value your feedback. If you have additional information, please reactivate the bug or submit a new bug with more details on how to reproduce the issue. You can also read the guidelines at <https://connect.microsoft.com/IE/content/content.aspx?ContentID=16254> regarding filing a good bug report.

Best regards,

The Internet Explorer Team
Posted by jaskaranthind on 12/10/2010 at 7:30 AM
I am also facing a similar issue and have posted on the link https://connect.microsoft.com/IE/feedback/details/630253/method-call-from-javaapplet-to-javascript-through-jsobject-no-longer-works-in-ie9?wa=wsignin1.0#

can you please suggest a solution to this problem?
Posted by Wilfred van der Deijl on 11/24/2010 at 1:43 PM
See bug report 624397 for a reproducing testcase. Simply visit http://static.commit-consulting.com/ie9bug/IE9bug.html to see the problem in action
Posted by shimax on 11/10/2010 at 1:45 PM
Does script.js exist in the head section(between <head> and </head>)?
If Java applet is loaded at first, and then script.js is loaded, there is no wonder even if the error occurs.

If you prepare a small test example, people will more easily confirm the bug. To prepare a test applet file is a little bit time consuming.