Openjdk + icedtea6 plugin fails to load parameters from jnlp files

Bug #544888 reported by wdesmet
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenJDK
Fix Released
Medium
openjdk-6 (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I was testing applets in the tutorials, this one doesn't work:
http://java.sun.com/docs/books/tutorial/deployment/applet/param.html (scroll down for applet)

When launching firefox from console, an error is reported:
java.lang.NumberFormatException: null
 at java.lang.Integer.parseInt(Integer.java:443)
 at java.lang.Integer.parseInt(Integer.java:514)
 at AppletTakesParams.init(AppletTakesParams.java:39)
 at sun.applet.AppletPanel.run(AppletPanel.java:436)
 at java.lang.Thread.run(Thread.java:636)

This is caused by the parameter "paramInt" being unavailable. This parameter is defined in a jnlp file, reference in the HTML as such:
<applet code="AppletTakesParams.class" archive="examples/dist/applet_AppletWithParameters/applet_AppletWithParameters.jar" height="50" width="800"><param name="jnlp_href" value="examples/dist/applet_AppletWithParameters/applettakesparams.jnlp">....</applet>

The page works with sun's jre in ubuntu and windows under firefox.

Revision history for this message
In , Matthias Klose (doko) wrote :

NP Plugin 20100320

http://java.sun.com/docs/books/tutorial/deployment/applet/param.html

This is caused by the parameter "paramInt" being unavailable. This parameter is defined in a jnlp file, reference in the HTML as such:
<applet code="AppletTakesParams.class" archive="examples/dist/applet_AppletWithParameters/applet_AppletWithParameters.jar" height="50" width="800"><param name="jnlp_href" value="examples/dist/applet_AppletWithParameters/applettakesparams.jnlp">....</applet>

The page works with sun's jre in linux and windows under firefox.

$ firefox 2>&1 | tee error.log
Looking for 0xa8eb310c 0xa8dd3c40 0xb74fdbcc (document)
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8pre) (6b18~pre3-0ubuntu1)
OpenJDK Server VM (build 16.0-b13, mixed mode)
java.lang.InterruptedException: sleep interrupted
 at java.lang.Thread.sleep(Native Method)
 at sun.applet.PluginAppletViewer.handleMessage(PluginAppletViewer.java:735)
 at sun.applet.PluginAppletViewer.handleMessage(PluginAppletViewer.java:649)
 at sun.applet.PluginStreamHandler.handleMessage(PluginStreamHandler.java:270)
 at sun.applet.PluginMessageHandlerWorker.run(PluginMessageHandlerWorker.java:82)
java.lang.InterruptedException: sleep interrupted
 at java.lang.Thread.sleep(Native Method)
 at sun.applet.PluginAppletViewer.handleMessage(PluginAppletViewer.java:629)
 at sun.applet.PluginStreamHandler.handleMessage(PluginStreamHandler.java:270)
 at sun.applet.PluginMessageHandlerWorker.run(PluginMessageHandlerWorker.java:82)
java.lang.InterruptedException: sleep interrupted
 at java.lang.Thread.sleep(Native Method)
 at sun.applet.PluginAppletViewer.handleMessage(PluginAppletViewer.java:674)
 at sun.applet.PluginAppletViewer.handleMessage(PluginAppletViewer.java:649)
 at sun.applet.PluginStreamHandler.handleMessage(PluginStreamHandler.java:270)
 at sun.applet.PluginMessageHandlerWorker.run(PluginMessageHandlerWorker.java:82)
java.lang.ArrayIndexOutOfBoundsException: 5
 at sun.applet.PluginProxyInfoRequest.parseReturn(PluginProxyInfoRequest.java:65)
 at sun.applet.PluginStreamHandler.finishCallRequest(PluginStreamHandler.java:338)
 at sun.applet.PluginStreamHandler.handlePluginMessage(PluginStreamHandler.java:287)
 at sun.applet.PluginStreamHandler.handleMessage(PluginStreamHandler.java:208)
 at sun.applet.PluginMessageHandlerWorker.run(PluginMessageHandlerWorker.java:82)
java.lang.NumberFormatException: null
 at java.lang.Integer.parseInt(Integer.java:443)
 at java.lang.Integer.parseInt(Integer.java:514)
 at AppletTakesParams.init(AppletTakesParams.java:39)
 at sun.applet.AppletPanel.run(AppletPanel.java:436)
 at java.lang.Thread.run(Thread.java:636)

Revision history for this message
In , Matthias Klose (doko) wrote :

Created attachment 319
plugin debug log

Changed in openjdk-6 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in openjdk:
status: Unknown → Confirmed
Revision history for this message
Agrv (agrv) wrote :

Hi,

In fact, it seems that the icedtea6 plugin is completely ignoring the jnlp_href parameter.
Is the support of the jnlp_href param for applets planned ? I can't find any information about it.
Thanks for your time and answer.

Regards.

Revision history for this message
In , Omajid (omajid) wrote :

Created attachment 366
first cut at a patch to add support for reading JNLP files for applets

Revision history for this message
In , Asu-3 (asu-3) wrote :

Created attachment 430
Allow applets to read JNLP files for parameters given jnlp_href

(In reply to comment #2)
> Created an attachment (id=366) [details]
> first cut at a patch to add support for reading JNLP files for applets
>

Hello,

I have made some modification in regards to this issue, I had originally thought of placing the parsing inside the PluginAppletViewer part of the code, however it would be better if I kept the jnlp stuff within netx. I took a sneak peek at your patch and decided that placing it in the PluginBridge(...) section was a good idea, however I did not think the other changes were necessary. I have changed it to do this much less complicated. Here is the attached patch I would like to propose.

--Andrew

ps. Thanks to Omair's patch for idea.

Revision history for this message
In , Omajid (omajid) wrote :

(In reply to comment #3)
> Created an attachment (id=430) [details]
> Allow applets to read JNLP files for parameters given jnlp_href
>
> (In reply to comment #2)
> > Created an attachment (id=366) [details] [details]
> > first cut at a patch to add support for reading JNLP files for applets
> >
>
> Hello,
>
> I have made some modification in regards to this issue, I had originally
> thought of placing the parsing inside the PluginAppletViewer part of the code,
> however it would be better if I kept the jnlp stuff within netx. I took a sneak
> peek at your patch and decided that placing it in the PluginBridge(...) section
> was a good idea, however I did not think the other changes were necessary. I
> have changed it to do this much less complicated. Here is the attached patch I
> would like to propose.
>

Heh. I am not going to deny that the patch was complex :). It probably has a number of issues. It's why I didnt post it for review.

However, it implemented much more of the applet-jnlp support. Take a look at http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/runAppletFunction.html to find out all the different cases where values supplied by the applet are supposed to be ignore/overwritten by values from the jnlp file.

Revision history for this message
In , Asu-3 (asu-3) wrote :

Aha! I'll take it for another spin, thanks for pointing it out :)

Cheers,
  Andrew

Changed in openjdk:
status: Confirmed → In Progress
Changed in openjdk:
importance: Unknown → Medium
Revision history for this message
In , Dbhole (dbhole) wrote :

*** Bug 672 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Asu-3 (asu-3) wrote :

Created attachment 543
Updated patch

This is an updated patch which will allow the user to specify parameters in JNLP files and use it for their applets.

Please let me know if I had missed anything, I've posted it for review at http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-June/014608.html

Cheers,
  Andrew

Revision history for this message
In , Asu-3 (asu-3) wrote :

Hi, I have pushed an fix to HEAD after splitting up the patch.

http://icedtea.classpath.org/hg/icedtea-web/rev/a25cdbe75706
http://icedtea.classpath.org/hg/icedtea-web/rev/011a29a0d8a2

Closing as fixed.

Cheers,
 Andrew

Changed in openjdk:
status: In Progress → Fix Released
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.