The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Invoking a public method in a applet from an external source

Posted by Rakesh on October 28, 2000 at 5:33 PM

I have a third-party applet from the internet that I cannot modify. This third party applet has a singleton class, and I want to invoke a public method within this singleton class.

The approach that I'm using is to have an applet on my machine and invoke the public method on the singleton class. (Any other approach is welcome!). I have a HTML button on my html page. Using Javascript, if anybody clicks on this button, a method in my local applet is invoked. This method in my local applet will in turn try to get a reference to the singleton class, and then try to invoke the specific method. This approach is failing. I am getting the following error message in the JavaScript console :-

JavaScript Error: uncaught JAVA exception
("security.Invalid access to ClassLoader")

The browser that I'm using is Netscape 4.76, and the jre in's vn's version is 1.2.2, and my local machine is a Windows NT workstation. I have enabled all permissions for the third-party applet. I have added one line in the prefs.js (Netscape's preferences file) that gives my local applet 3.0 powers. I have included the folder that contains my local applet in the CLASSPATH.

I would like to know whats wrong. Any suggestions are more than welcome.

(My suspicion: Since the two applets are starting from different sources, each of the applets are running in a different class loader. If this is the problem is there any way that I can run the two applets within the same class loader.)

Thanks in advance


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us