Bug 487872 - openjdk java plugin does not work in firefox (behind authenticated proxy)
Summary: openjdk java plugin does not work in firefox (behind authenticated proxy)
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Deepak Bhole
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-28 15:28 UTC by pankaj pandey
Modified: 2009-06-02 14:31 UTC (History)
5 users (show)

Fixed In Version: 1.6.0.0-18.b16.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-29 14:08:28 UTC
Type: ---
Embargoed:


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 07:28 UTC, pankaj pandey
no flags Details
PluginMain.java file with primitive proxy support (13.19 KB, text/plain)
2009-03-03 07:38 UTC, pankaj pandey
no flags Details

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.


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