Bug 487872 - openjdk java plugin does not work in firefox (behind authenticated proxy)
openjdk java plugin does not work in firefox (behind authenticated proxy)
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Deepak Bhole
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-28 10:28 EST by pankaj pandey
Modified: 2009-06-02 10:31 EDT (History)
5 users (show)

See Also:
Fixed In Version: 1.6.0.0-18.b16.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-29 10:08:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A diff of the file i made to implement http proxy support in the plugin (5.42 KB, application/octet-stream)
2009-03-03 02:28 EST, pankaj pandey
no flags Details
PluginMain.java file with primitive proxy support (13.19 KB, text/plain)
2009-03-03 02:38 EST, pankaj pandey
no flags Details

  None (edit)
Description pankaj pandey 2009-02-28 10:28:55 EST
Description of problem:
Openjdk does not load any java applet from the internet. Local java applets work fine. I am behind an authenticated proxy which i need to access external sites/internet.
I get the following error messages on the terminal
'''
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet.
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:472)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:418)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:597)
Caused by: java.lang.NullPointerException
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:458)
	... 2 more
Caused by: 
java.lang.NullPointerException
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:458)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:418)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:597)
java.lang.NullPointerException
	at net.sourceforge.jnlp.NetxPanel.runLoader(NetxPanel.java:97)
	at sun.applet.AppletPanel.run(AppletPanel.java:380)
	at java.lang.Thread.run(Thread.java:636)
java.lang.NullPointerException
	at sun.applet.AppletPanel.run(AppletPanel.java:430)
	at java.lang.Thread.run(Thread.java:636)
'''
This message is repeated a lot of times, probably once for each refresh of the page i do.
The sun java applet works fine (loads too slow, asks for proxy password dialog when it loads the first applet in a session).

Version-Release number of selected component (if applicable):
java-1.6.0-openjdk-plugin-1.6.0.0-9.b14.fc10.i386

How reproducible:
Always

Steps to Reproduce:
1. Open any web page with a java applet ( http://www.java.com/en/download/help/testvm.xml ).
  
Actual results:
Grey rectangle appears where the applet should be, firefox statusbar shows "starting applet...". It stays in that state.

Expected results:
The applet should be displayed properly

Additional info:
I am behind an authenticated proxy to access internet. Local applets on my computer seem to work fine. Same problem exists with epiphany browser
Comment 1 Deepak Bhole 2009-02-28 14:30:52 EST
NetX (WebStart) and the the plugin do not support proxy at the moment. I will take a look into this on Monday.
Comment 2 pankaj pandey 2009-03-02 05:14:46 EST
Thanks for looking into it. If NetX (WebStart) and the plugin do not support proxies at the moment then i suppose it may take a long time. In the meanwhile is there any hack we could use to workaround the problem.
I tried putting these into the main method in the file 'sun.applet.PluginMain' (java-1.6.0-openjdk-1.6.0.0-9.b14.fc10.src/icedtea6-1.4/plugin/icedtea/sun/applet in the source rpm) and adding to the system rt.jar: 
"
        Properties props = System.getProperties();
        props.put("http.proxyHost", "myproxy.site.com");
        props.put("http.proxyPort", "80");
        props.put("http.proxyUser", "user");
        props.put("http.proxyPassword", "pwd");
        System.setProperties(props);
"
but still it doesnt work. Is there anything else i could do. Like setting the URL.setURLStreamHandlerFactory() or something else so that it may work (need not be a good permanent soln, a temporary hack with hardcoded values will be fine)
Thanks again, and i'll be glad for any further information/testing which i could do.
Comment 3 Deepak Bhole 2009-03-02 09:41:26 EST
Putting that in the main method should have worked. How exactly did you make the modifications and rebuild?
Comment 4 Deepak Bhole 2009-03-02 13:51:19 EST
Okay, I know why it is not working. You are using an authenticated proxy you said? There is no way you can set the user and password for it via system properties. The Java api only allows host and port specification:

http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html
Comment 5 pankaj pandey 2009-03-03 01:30:50 EST
Ya i got that to work using Authenticator class. It was a hack for my specific values so now i'm trying to get it to use the http_proxy env variable. It was easy actually. Donno why no one ever implemented it.
Comment 6 pankaj pandey 2009-03-03 02:28:16 EST
Created attachment 333844 [details]
A diff of the file i made to implement http proxy support in the plugin

A diff of the file i made to implement http proxy support in the plugin
Comment 7 pankaj pandey 2009-03-03 02:38:38 EST
Created attachment 333847 [details]
PluginMain.java file with primitive proxy support

I dont know if diffs are any useful so i'm rather sending the exact file which i made. I've implemented primitive support for taking proxy settings from environment variables for http and https. It should work well until this feature is properly implemented. I've tested it in epiphany and firefox for both local applets (file://) and internet applets (http://). However i'm not sure if it'll work with http://localhost applets (it doesn't handle proxy exceptions for now - "no_proxy" environment variable). I'd be glad if this feature made it fast to the plugin.
Thanks
Comment 8 Fedora Update System 2009-05-30 10:16:23 EDT
java-1.6.0-openjdk-1.6.0.0-18.b16.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-18.b16.fc10
Comment 9 Fedora Update System 2009-05-30 10:17:17 EDT
java-1.6.0-openjdk-1.6.0.0-22.b16.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-22.b16.fc11
Comment 10 Fedora Update System 2009-06-02 10:23:07 EDT
java-1.6.0-openjdk-1.6.0.0-22.b16.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2009-06-02 10:30:40 EDT
java-1.6.0-openjdk-1.6.0.0-18.b16.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.