Bug 487872

Summary: openjdk java plugin does not work in firefox (behind authenticated proxy)
Product: [Fedora] Fedora Reporter: pankaj pandey <pankaj86>
Component: java-1.6.0-openjdkAssignee: Deepak Bhole <dbhole>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: dbhole, langel, lkundrak, mjw, pankaj86
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 14:08:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A diff of the file i made to implement http proxy support in the plugin
none
PluginMain.java file with primitive proxy support none

Description pankaj pandey 2009-02-28 15:28:55 UTC
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 19:30:52 UTC
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 10:14:46 UTC
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 14:41:26 UTC
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 18:51:19 UTC
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 06:30:50 UTC
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 07:28:16 UTC
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 07:38:38 UTC
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 14:16:23 UTC
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 14:17:17 UTC
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 14:23:07 UTC
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 14:30:40 UTC
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.