The old plugin hangs firefox 3 when loading java applets

Bug #288397 reported by Elias Naur on 2008-10-23
This bug report is a duplicate of:  Bug #291135: Out of date java 6 plugin installed. Edit Remove
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Sun Java
Confirmed
Unknown
sun-java6 (Ubuntu)
Undecided
Unassigned

Bug Description

I've just got a report from a user of our site, tribaltrouble2.com, that the applet we use on the site hangs with firefox 3 and the version of the java plugin provided by Ubuntu 8.10. The applet does not cause a hang on earlier java versions < 1.6 update 10, which is installed on 8.04. I've confirmed the hang, and that selecting "plugin2" instead of the legacy plugin resolves the hang.

What's special about the java 6u10 "minor" update is that SUN rewrote the browser plugin, "plugin2", (https://jdk6.dev.java.net/plugin2/) to resolve quite a few issues with the old plugin. However, SUN still distributes the legacy plugin and it seems that the 8.10 packaged version of sun-java6-plugin still uses that. I strongly suggest that the package upgrades to plugin2 as it not only resolves the ff3 hang, but is also a much better plugin.

Specifically, using

jre/lib/i386/libnpjp2.so

instead of

jre/plugin/i386/ns7/libjavaplugin_oji.so

selects plugin2 and resolves the bug. The alternatives, doing nothing or downgrading java to an earlier version < 6u10 is suboptimal, IMHO.

Elias Naur (elias-naur) wrote :

Details about linux installation is provided here:

https://jdk6.dev.java.net/plugin2/#INSTALLATION

James Stansell (jamesstansell) wrote :

Hi Elias,

Your suggestion is fine with me personally, but there are still a lot of people who want to use sun-java6-plugin with Firefox 2, which can't use the new plugin2 from 6u10.

Is there a bug open in Sun's bug parade for the regression of the classic plugin?

-james.

Elias Naur (elias-naur) wrote :

No there is not. The response times of Sun is quite long, and I don't think they'll want to divert that many resources on a bug with the legacy plugin which is resolved with the new plugin (assuming there isn't a hang problem with FF2 - I haven't tested) , so with the 'easy' workaround available I was hoping for a quick resolution from the ubuntu side.

That said, what's wrong with supplying two packages, sun-java6-plugin and sun-java6-plugin2, the latter only available (and the default) for FF3?

 - elias

Just installed sun-java6-plugin and got a crash with FF3 ... on Ctrl, Alt and Backspace (the X server stopped responding) I noticed a few error messages that I'd never seen before.

Just installed the java 5 plugin... works just fine

Changed in sun-java:
status: Unknown → Confirmed
ThorbjørnTux (martsummsw) wrote :

LumpyCustard , how did you install sun-java5-plugin ?

In Bug 288642 I thought that I had tried sun-java5-plugin with
sudo apt-get remove sun-java6-plugin
and
sudo apt-get install sun-java5-plugin

However it still ran the java6-plugin. (I have realized now)
Even with :
sudo apt-get remove sun-java6-plugin
sudo apt-get autoremove
sudo apt-get install sun-java5-plugin

The links refers to sun-java6-plugin - and I get no (working) java.
(Maybe it should be reported as a separate bug)

Beside I think the priority of this should be set to high.
(When a lot of Java applets (e.g. Internet banking) does not work - I would consider the problem to be big)

Adam Niedling (krychek) wrote :

I wasn't sure which report should be the main one, I think all duplicate reports are worth reading.

I installed and removed via the Synaptic gui.

I can't remember exactly what I did, but usually I perform a complete removal, especially when in this case there are no other dependencies.

Adam Niedling (krychek) wrote :

A working workaround:

1. Create this directory in your home directory: .mozilla/firefox/plugins/
2. Create a symlink in this directory: ln -s /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386/libnpjp2.so libnpjp2.so

My netbank is working now.

Nils Fredrik Gjerull (nfg) wrote :

The JUpload applet (http://jupload.sourceforge.net/) is experiencing this issue.

I have tried with the sun-java5-plugin and sun-java6-plugin (the old libjavaplugin_oji.so plugin that is). Both of them make Firefox 3.0.3 freeze. Maybe this is a issue with Firefox 3.0.3 and the old plugin?

I removed the symbolic link to the old plugin in a number of places:
/usr/lib/xulrunner/plugins/libjavaplugin.so
/usr/lib/xulrunner-addons/plugins/libjavaplugin.so
/usr/lib/mozilla/plugins/libjavaplugin.so
/usr/lib/firefox/plugins/libjavaplugin.so

I am not sure which of these is actually used by Firefox or if Firefox picks up plugins from a number of places, but removing the link from these places prevented Firefox from discovering the old plugin.

Then I added a symbolic link in the $HOME/.mozilla/plugins directory:
ln -s /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386/libnpjp2.so

Now the jupload java applet is working, with the new plugin.

Nils Fredrik Gjerull (nfg) wrote :

After some after thought I think it would be better to use the alternatives system than to remove the symbolic links.

Do this:
sudo update-alternatives --install /etc/alternatives/xulrunner-1.9-javaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /etc/alternatives/xulrunner-javaplugin.so xulrunner-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /etc/alternatives/firefox-javaplugin.so firefox-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /etc/alternatives/mozilla-javaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100

Or you can do this with the GUI tool galternatives.

This will change to the new java plugin system wide.

Nils, I think the update-alternatives should rather be used as follows:

sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100

and so on. The first argument should be the file in the filesystem which *points to* /etc/alternatives/XYZ

dnh (dnh) wrote :

I have the same bug using my netbank (Danish Eikbank), never had any problems < 8.10.

This works for me:
https://bugs.launchpad.net/ubuntu/+source/sun-java6/+bug/288642/comments/37

Adam Niedling (krychek) wrote :

I just tried Nils's solution at 2008-11-11 and it does not work for me. I hope it didn't damage my system.
Alexander: could you write the complete solution which you've tested and is working? Thanks.

Nils Fredrik Gjerull (nfg) wrote :

Sorry for the mistake in the update-alternatives command. This I have tested and it is working if you have sun-java6-bin installed. If you can move the applet at the following URL everything should be OK; https://jdk6.dev.java.net/plugin2/

Updatet commands:
sudo update-alternatives --install /usr/lib/xulrunner-1.9.0.4/plugins/libjavaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /usr/lib/xulrunner/libjavaplugin.so xulrunner-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /usr/lib/firefox/plugins/libjavaplugin.so firefox-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100

Adam Niedling (krychek) wrote :

Screw update-alternatives. This didn't work either. It doesn't even change the symlinks in /etc/alternatives/ . And I also didn't even had the /usr/lib/xulrunner/libjavaplugin.so and /usr/lib/mozilla/plugins/libjavaplugin.so files. I ended up creating every symlink manually:

sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so /etc/alternatives/xulrunner-1.9-javaplugin.so
sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so /etc/alternatives/xulrunner-javaplugin.so
sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so /etc/alternatives/firefox-javaplugin.so
sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so /etc/alternatives/mozilla-javaplugin.so

sudo ln -s /etc/alternatives/xulrunner-1.9-javaplugin.so /usr/lib/xulrunner-1.9.0.4/plugins/libjavaplugin.so
sudo ln -s /etc/alternatives/xulrunner-javaplugin.so /usr/lib/xulrunner/libjavaplugin.so
sudo ln -s /etc/alternatives/firefox-javaplugin.so /usr/lib/firefox/plugins/libjavaplugin.so
sudo ln -s /etc/alternatives/mozilla-javaplugin.so /usr/lib/mozilla/plugins/libjavaplugin.so

If any of these files already exist they should be deleted, otherwise the new symlink cannot be created.
I made a shell script to do all this. I'm attaching it. Don't worry if you get an error message saying that something can't be deleted.

This works 100%! I tested it on two computers and this workaround also survives a reboot.

Troels Liebe Bentsen (tlbdk) wrote :

It seems that "auto" has been disabled on the symlinks if the update-java-alternatives has been used.

So to for the update-alternatives to work, auto first has to be set on the plugins:

update-alternatives --auto xulrunner-1.9-javaplugin.so
update-alternatives --auto xulrunner-javaplugin.so
update-alternatives --auto firefox-javaplugin.so
update-alternatives --auto mozilla-javaplugin.so

sudo update-alternatives --install /usr/lib/xulrunner-1.9.0.4/plugins/libjavaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /usr/lib/xulrunner/libjavaplugin.so xulrunner-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /usr/lib/firefox/plugins/libjavaplugin.so firefox-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100
sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 100

But all this should really be done in the deb, why still ship a broken plugin when there is a working alternative?

Nils Fredrik Gjerull (nfg) wrote :

If you have for example icedtea6-plugin installed I think it has a higher priority than sun-java6-plugin because it is FOSS. I just used 100 as the priority because it is higher than the old plugin in sun-java6-plugin.

You can install the GUI tool galternatives so you more easily can see which alternative is active.

This should be done in the deb.

Doug Holton (edtechdev) wrote :

I reported this too and posted a solution that worked for me.
https://bugs.launchpad.net/ubuntu/+source/sun-java6/+bug/291135

Someone marked the bug fixed now upstream, but I can't confirm it.

Jimmy Merrild Krag (beruic) wrote :

I have added to your post how I got it working on intrepid by installing the binary package from Sun. Still have a few things to test, but works perfectly with applets.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.