[icedtea-web] RFC: Patch to support plugin classloader sharing
dbhole at redhat.com
Wed Mar 2 17:56:16 PST 2011
* Dr Andrew John Hughes <ahughes at redhat.com> [2011-03-02 20:33]:
> On 17:17 Wed 02 Mar , Deepak Bhole wrote:
> > This patch allows plugins from the same page to use the same
> > classloader.
> > There are known applets (Microsoft Live Meeting, *.map24.com) which rely
> > on this behaviour as they try to access static variables from one applet
> > through another.
> > ChangeLog:
> > 2011-03-02 Deepak Bhole <dbhole at redhat.com>
> > Fix RH604061: Microsoft Live Meeting doesn't work
> > Fix PR475: (uk.map24.com) Applet doesn't stop loading
> > * configure.ac: Added checks for sun.misc.JarIndex and
> > sun.misc.URLClassPath
> > * netx/net/sourceforge/jnlp/PluginBridge.java
> > (PluginBridge): Set unique key based on document base (i.e. plugin origin
> > page).
> > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
> > (getInstance): When trying to compare against file.getFileLocation(),
> > ensure that it is a JNLP application. If it is a plugin and baseloader is
> > not null, marge the loaders.
> > (merge): Use the new addFileURLsFirst function.
> > (addFileURLsFirst): New function. Adds a url to the search path and moves
> > it to the top if it is a file (jar/zip/etc.) path.
> > * NEWS: Updated.
> > This should go in 1.1 only for now.
> > Cheers,
> > Deepak
> Comments inline.
> > diff -r 5dbf0f9de599 NEWS
> > --- a/NEWS Wed Mar 02 11:50:30 2011 -0500
> > +++ b/NEWS Wed Mar 02 17:16:03 2011 -0500
> > @@ -21,7 +21,9 @@
> > - Use Firefox's proxy settings if possible
> > - RH669942: javaws fails to download version/packed files (missing support for jnlp.packEnabled and jnlp.versionEnabled)
> > * Plugin
> > + - PR475: (uk.map24.com) Applet doesn't stop loading
> > - PR612: NetDania application ends on java.security.AccessControlException: access denied (java.util.PropertyPermission browser read)
> > + - RH604061: Microsoft Live Meeting doesn't work
> If this is the same bug, then it should be one line:
> - PR475, RH604061: Allow applets from the same page to use the same classloader
> > New in release 1.0 (2010-XX-XX):
> This is horrible. Not only is it going to break if the implementation details of
> URLClassLoader change (have you checked OpenJDK7?) but it will fail with any
> different implementation of URLClassLoader. Can you not override a method or
> use our own classloader instead of this awful hack?
Yep, I agree 100% .. (well 99.9 :)) that it is a terrible hack.
The security re-design will rewrite significant parts of the classloader
and I am going to make sure that this method, or nothing like it exists
thereafter. With this gone, the additional sun.misc.* dep will be gone
too. Overriding is not possible because the methods and fields are
private. Good point re: OpenJDK7 though. I will take a look.
Until the rewrite, this is really the only way I can think of to share
classloaders and not have the client hammer the server by trying to load
each class from an http://.../ path first. Bad code aside though, I do
think it is worthwhile putting it in in the interim assuming it is
stable (which it was in all my testing) with IcedTea and IcedTea6.
> > }
> Andrew :)
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
> Support Free Java!
> Contribute to GNU Classpath and IcedTea
> PGP Key: F5862A37 (https://keys.indymedia.org/)
> Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the distro-pkg-dev