JNLP file limit...

Hi,

I am using Java Web Start to distribute an application that use the JAI api. I have created 2 separate JNLP file, one for my application and one for the JAI stuff.

My application and the JAI JNLP look like this (I have edited some stuff for security reason...).

This one work fine on my station if I comment the JAI downloading stuff, as JAI is already on my station, so I include it just in case and since I myself search a lot for it, so that someone may find it usefull...

<?xml version="1.0" encoding="utf-8"?>

<!-- JNLP Filefor PLNSPooler Client Application -->

<jnlp spec="1.5+" codebase="http://servername/PLNSpooler/" href="plnspooler.jnlp">

<information>

<title>PLN530 Drawing Spooler</title>

</information>

<security>

<all-permissions/>

</security>

<resources>

<j2se version="1.5+" java-vm-args="-esa -Xnoclassgc"/>

<jar href="download/Client.jar"/>

<jar href="download/PLN_Core.jar"/>

<jar href="download/log4j-1.2.8.jar"/>

<jar href="download/log4j_extension.jar"/>

<extension name="JAI" href="http://servername/JAI/jai.jnlp"/>

</resources>

<application-desc main-class="util.spooler.Client">

<argument>bla bla bla</argument>

<argument>bla bla bla</argument>

</application-desc>

</jnlp>

Now this is the one that is giving me some troubles... The "jai_windows-i586.jar" jar is really just a shell for the JAI installer as I could see opening the file. And it's a little over the 5 meg size.

<?xml version="1.0" encoding="utf-8"?>

<!-- JNLP Filefor Java Advance Imaging -->

<jnlp spec="1.0+" codebase="http://servername/JAI/" href="jai.jnlp">

<information>

<title>Java Advance Imaging</title>

<vendor>Sun Microsystems, Inc.</vendor>

</information>

<security>

<all-permissions/>

</security>

<resources>

<extension href="download/jai_windows-i586.jar"/>

</resources>

<component-desc/>

</jnlp>

When JWS is up to this (just above) JNLP (called from my application JNLP), it appear that the jar file "jai_windows-i586.jar" is "too big" for JWS. When I try to download the application, when at the point of getting that specific jar (as I can see in the status display) I get the following error:

An error occurredwhile launching/running the application.

Title: Drawing Spooler

Vendor:

Category: Unexpected Error

File too large

With the following exception:

java.io.IOException: File too large

at com.sun.javaws.jnl.LaunchDescFactory.readBytes(Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)

at com.sun.javaws.LaunchDownload.downloadExtensionsHelper(Unknown Source)

at com.sun.javaws.LaunchDownload.downloadExtensionsHelper(Unknown Source)

at com.sun.javaws.LaunchDownload.downloadExtensions(Unknown Source)

at com.sun.javaws.Launcher.downloadResources(Unknown Source)

at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)

at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)

at com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

I tried using the size attribut to the extension element using size="5482423" where this size is the actual size in byte as reported by Window for the file. But still it did not work.

Researching this here, I found someone else with a similar problem (2 years ago), but no answer. I am hopping someone will have an answer for me now...

Thank you in advance.

[4600 byte] By [EricTherriena] at [2007-10-1 0:26:44]
# 1

The problem here is that you use:

<extension href="download/jai_windows-i586.jar"/>

the href of an extension element is another jnlp file, not a jar file.

That is why there is a file size limit (sanity check of 1 Mg).

look at the jnlp specification for a description of haw to use extensions:

http://java.sun.com/products/javawebstart/download-spec.html

/Dietz

dietz333a at 2007-7-7 16:13:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
actually you are using the extension mechinism correctly in pnlpspooler.jnlp. in jai.jnlp you need to change :<extension href="download/jai_windows-i586.jar"/>to <jar href="download/jai_windows-i586.jar"/>/Dietz
dietz333a at 2007-7-7 16:13:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
That was it! I mis-read the spec.Thank's
EricTherriena at 2007-7-7 16:13:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

I'm still having a problem...

The JAI jar, that I picked up on the JAI download page, wich is to be use for applet and wich only iclude an .exe does not install. When I lunch the application (after revising the jai.jnlp file as below to specify it as an installer) it seem to be trying to install and after a few quick scrolling of the status, JWS simply quit and nothing happen. Nothing get installed in the JRE directory.

Using the "installer-desc" element require (either specifically or using the manifest) a main-class for the installer, as it will run a java class to install... There is no such thing in the Sun jar for installing JAI...

Is there any way to still install this?

Here's my revise JNLP for JAI:

<?xml version="1.0" encoding="utf-8"?>

<!-- JNLP File for Java Advance Imaging -->

<jnlp spec="1.0+" codebase="http://servername/JAI/" href="jai.jnlp">

<information>

<title>Java Advance Imaging</title>

<vendor>Sun Microsystems, Inc.</vendor>

</information>

<security>

<all-permissions/>

</security>

<resources>

<jar href="download/jai_windows-i586.jar"/>

</resources>

<installer-desc/>

</jnlp>

Here's the manifest from the JAI jar:

Manifest-Version: 1.0

Extension-Name: javax.media.jai

Extension-Installation: jai-1_1_2-lib-windows-i586-jre.exe

Specification-Version: 1.1-mr

Implementation-Version: 1.1.2

Name: jai-1_1_2-lib-windows-i586-jre.exe

SHA-Digest: lPwIVhpNau4gtN5x7O4TUivbFyM=

SHA1-Digest: lPwIVhpNau4gtN5x7O4TUivbFyM=

MD5-Digest: 1VKtVGfw6sttDhbdYyXX3g==

Digest-Algorithms: SHA MD5

The only thing in this jar, beside the manifest and signing stuff is the "jai-1_1_2-lib-windows-i586-jre.exe" file.

I guess what this should get at is that it should perform the installation the same way the JRE is installed if it's not present, but so far I have not found how it's done reading the spec...

EricTherriena at 2007-7-7 16:13:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...