firefox java applet fails when the firefox is launched by a java program

Bug #1091926 reported by Fajrian Yunus
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Won't Fix
Medium
firefox (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hi Support Team,

I run a simple Java program (a runnable jar file). The Java program code is as following

import java.io.IOException;
public class Main {
     public static void main(String args[]) throws IOException {
          //this website has a small Java applet inside
          Runtime.getRuntime.exec("firefox http://javatester.org/version.html");
          System.out.println("hello world");
     }
}

My JRE (yes, JRE, not JDK) is Oracle JRE 1.6.0_38.

What the program does is essentially opening http://javatester.org/version.html in Firefox. This website has a small Java applet, so performance won't be a problem. What happens then is that, Firefox is opened, http://javatester.org/version.html is opened, BUT the applet inside the website FAILS to play. The same thing happens if my Java program opens any other website which has applet.

However, if I run "firefox http://javatester.org/version.html" from command line, everything works perfectly. Similarly, if I open Firefox, then I type http://javatester.org/version.html at the URL field, everything also works perfectly.

This problem happens in Firefox, but NOT in Chromium (which I installed from your standard repository).

This problem doesn't happen in Oracle Linux distro. I haven't tried in other Linux distros, though.

Thank you

Fajrian Yunus

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: firefox 17.0.1+build1-0ubuntu0.12.10.1
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic x86_64
AddonCompatCheckDisabled: False
ApportVersion: 2.6.1-0ubuntu3
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: anakin 1700 F.... pulseaudio
BuildID: 20121129151842
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
Channel: Unavailable
Date: Wed Dec 19 09:46:27 2012
ForcedLayersAccel: False
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationMedia: Kubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.1)
IpRoute:
 default via 10.0.2.2 dev eth0 proto static
 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 metric 1
 169.254.0.0/16 dev eth0 scope link metric 1000
IwConfig:
 eth0 no wireless extensions.

 lo no wireless extensions.
Plugins: Java(TM) Plug-in 1.6.0_38 - /usr/lib/jvm/jre1.6.0_38/lib/amd64/libnpjp2.so
PrefSources: prefs.js
ProcEnviron:
 LANGUAGE=en_SG:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_SG.UTF-8
 SHELL=/bin/bash
Profiles: Profile0 (Default) - LastVersion=17.0.1/20121129151842 (In use)
RfKill:

RunningIncompatibleAddons: False
SourcePackage: firefox
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/01/2006
dmi.bios.vendor: innotek GmbH
dmi.bios.version: VirtualBox
dmi.board.name: VirtualBox
dmi.board.vendor: Oracle Corporation
dmi.board.version: 1.2
dmi.chassis.type: 1
dmi.chassis.vendor: Oracle Corporation
dmi.modalias: dmi:bvninnotekGmbH:bvrVirtualBox:bd12/01/2006:svninnotekGmbH:pnVirtualBox:pvr1.2:rvnOracleCorporation:rnVirtualBox:rvr1.2:cvnOracleCorporation:ct1:cvr:
dmi.product.name: VirtualBox
dmi.product.version: 1.2
dmi.sys.vendor: innotek GmbH

Revision history for this message
Fajrian Yunus (fajrian-yunus) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

Some problem with 12.04 32 bit (up to date) using firefox 18.

I not happens with firefox 16.

It not happens with Chromium.

It not happens with 64 bit (up to date) using firefox 18.

Running firefox from terminal I got the following error, that makes the difference:

(firefox:2823): GLib-WARNING **: Invalid UTF-8 passed to g_io_channel_write_chars().
/build/buildd/icedtea-web-1.2/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:1838: thread 0xb718b360: Error: Failed to write bytes to output channel: La seqüència de bytes a l'entrada de conversió no és vàlida

Last sentence is in Catalan language. The English version should look like:

The byte sequence in conversion input invalid

Regards,

Josep Pujadas-Jubany

Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

Same* problem

Sorry!

Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

Updated system yesterday (12.04 LTS 32 bit), with Firefox 23.0.

I still having the problem.

Example: http://tube.geogebra.org/student/m7399

It works using Chromium, but not using Firefox.

And everything it works with my desktop system (12.04 LTS 64 bit).

Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

I found that the problem is related to (use a java script to configure) a proxy server or not.

At Firefox I have a Java detecting proxy sequence such http://www.mywebsite.com/proxy.pac

If I use this sequence, Java Applets doesn't work. If I manually configure Firefox for not using the sequence, applets work.

And...

chromium-browser --proxy-pac-url=http://www.mywebsite.com/proxy.pac %u

doesn't have this problem!

Now I remember that with WinXP workstations I had to configure Oracle Java for use http://www.mywebsite.com/proxy.pac

I will look for similar workaround about Iced-Tea-Plugin...

Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

[IcedTea Web Control Panel] [Network] [Automatic proxy configuration script] solved my problem.

So, I think Firefox has same (proxy) problem in Linux and Windows...

Revision history for this message
In , Walter Garcia-Fontes (walter-garcia) wrote :

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 (Beta/Release)
Build ID: 20130807180628

Steps to reproduce:

R
Run a simple Java program (a runnable jar file). The Java program code is as following

import java.io.IOException;
public class Main {
     public static void main(String args[]) throws IOException {
          //this website has a small Java applet inside
          Runtime.getRuntime.exec("firefox http://javatester.org/version.html");
          System.out.println("hello world");
     }
}

My JRE (yes, JRE, not JDK) is Oracle JRE 1.6.0_38.

What the program does is essentially opening http://javatester.org/version.html in Firefox. This website has a small Java applet, so performance won't be a problem.

Actual results:

What happens then is that, Firefox is opened, http://javatester.org/version.html is opened, BUT the applet inside the website FAILS to play. The same thing happens if my Java program opens any other website which has applet.

However, if I run "firefox http://javatester.org/version.html" from command line, everything works perfectly. Similarly, if I open Firefox, then I type http://javatester.org/version.html at the URL field, everything also works perfectly.

This problem happens in Firefox, but NOT in Chromium (which I installed from your standard repository).

This problem doesn't happen in Oracle Linux distro. I haven't tried in other Linux distros, though.

Expected results:

Open http://javatester.org/version.html in Firefox

Revision history for this message
In , Walter Garcia-Fontes (walter-garcia) wrote :
Changed in firefox:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

See also https://bugs.launchpad.net/ubuntu/+source/icedtea-web/+bug/1222912

Something wrong when using proxy.pac

Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :

I confirm (that for me) the problem is proxy.pac related.

Up to now, I denied the access to www.mysite.com/proxy.pac for when users are outside, with their netbooks.

My Apache .htaccess looked like:

<Files proxy.pac>
 Order Deny,Allow
 Deny from All
 Allow from 192.168.0.0/16
</Files>

This worked for Chromium+IcedTea but not for Firefox+IcedTea.

Finally I had to use a new .htaccess like:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^192\.168\.
RewriteRule proxy\.pac$ http://www.mysite.com/direct.pac [R=301,L]

where direct.pac is:

function FindProxyForURL(url, host) {
   return "DIRECT";
}

Finally, Chromium+IcedTea don't understand the possibility to return more than a proxy (or proxy fail).

I had a proxy.pac ending by:

return "PROXY 192.168.0.3:8080; DIRECT";

and I had to put:

return "PROXY 192.168.0.3:8080";

Revision history for this message
In , Virtual-q (virtual-q) wrote :

I'm marking this bug as WONTFIX per bug #1269807.

For more information see - https://blog.mozilla.org/futurereleases/2015/10/08/npapi-plugins-in-firefox/

Changed in firefox:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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