Download Error Exception in 1.6. Works in all older versions.

I had some customers complaining that Java Web Start stopped working after upgrading to Java 1.6. I got the following after I upgraded.

JNLPException[category: Download Error : Exception: null : LaunchDesc: null ]

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

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

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

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

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

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

at com.sun.javaws.Main.launchApp(Unknown Source)

at com.sun.javaws.Main.continueInSecureThread(Unknown Source)

at com.sun.javaws.Main$1.run(Unknown Source)

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

I get the following on the console:

#### Java Web Start Error:

#### Unable to load resource: http://barracudaserver.com/products/BarracudaDrive/HttpsTunnelWS.jar

I have cleared the Java cache, but the Java client still sends a " If-Modified-Since" so the server responds with a 304 Not Modified.

If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT

That is a long time ago.

I have attached the HTTP headers at the bottom.

Any ideas?

BTW, it would be great if SUN could make things backward compatible. This JNLP file is integrated inside a product and requires that all customers upgrade the product.

A copy of the JNLP file is available online at:

http://barracudaserver.com/products/BarracudaDrive/HttpsTunnelClient.html

GET /products/BarracudaDrive/HttpsTunnelWS.jar HTTP/1.1

content-type: application/x-java-archive

accept-encoding: pack200-gzip,gzip

User-Agent: JNLP/6.0 javaws/1.6.0_01 (b06) Java/1.6.0_01

UA-Java-Version: 1.6.0_01

Host: barracudaserver.com

Cache-Control: no-cache

Pragma: no-cache

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive

If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT

Cookie: __utma=72791808.1501057734.1166376940.1177887848.1178031465.9; __utmz=72791808.1177300532.7.3.utmccn=(referral)|utmcsr=localhost|utmcct=/setup/wizard/SetAdmin.lsp|utmcmd=referral; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bi%3A-1%3B%7D

HTTP/1.1 304 Not Modified

Date: Tue, 01 May 2007 17:44:38 GMT

Server: BarracudaServer.com (Posix)

Connection: Keep-Alive

Content-Type: application/java

Etag: 461adac6

Last-Modified: Tue, 10 Apr 2007 00:31:02 GMT

Content-Length: 0

Message was edited by:

wi_ni

Message was edited by:

wi_ni

[2779 byte] By [wi_nia] at [2007-11-27 2:58:30]
# 1

I have the same issue. Please let me know if there a defect for this ?

There is a discrepancy in class file types in 1.5 and 1.6 java.

Follow this link.

Any one have any idea why the backward compatibility has been NOT Taken care?

http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/pack200.html#testing

(read the last paragraph)

Exception in javaws is as below.

java.io.IOException: Corrupted pack file: magic/ver = CAFED00D/160.1 should be CAFED00D/150.7

at com.sun.java.util.jar.pack.NativeUnpack.start(Native Method)

at com.sun.java.util.jar.pack.NativeUnpack.run(Unknown Source)

at com.sun.java.util.jar.pack.NativeUnpack.run(Unknown Source)

at com.sun.java.util.jar.pack.UnpackerImpl.unpack(Unknown Source)

at com.sun.deploy.net.HttpDownloadHelper.download(Unknown Source)

at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)

at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)

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

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

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

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

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

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

at com.sun.javaws.Main.launchApp(Unknown Source)

at com.sun.javaws.Main.continueInSecureThread(Unknown Source)

at com.sun.javaws.Main$1.run(Unknown Source)

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

Need help in getting a work around for this.

bharath-javaa at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 2
This error gives me the impression the Java Webstart is using runtime 1.5 to get to 1.6 resources. What is the JNLP stating as version?
riema at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 3

JNLP version ?

i tried to look up in my control panel

and i have in user tab

1.61.6.0_01http://java.sun.com/products/autodl/j2seC:\Program Files\Java\jre1.6.0_01\bin\javaw.exetrue

system tab

1.61.6.0_01http://java.sun.com/products/autodl/j2seC:\Program Files\Java\jre1.6.0_01\bin\javaw.exetrue

and java -version is

java version "1.6.0_01"

Java(TM) SE Runtime Environment (build 1.6.0_01-b06)

Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

here is my JNLP test program

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

<jnlp spec="1.0+" codebase="http://172.22.90.128/Rel05_01_052">

<information>

<title>JNLPTest</title>

<vendor>JNLPTest</vendor>

<description>JNLPTest</description>

<offline-allowed/>

</information>

<security><all-permissions/></security>

<resources>

<j2se version="1.5" initial-heap-size="64m" max-heap-size="512m"/>

<jar href="iMS/STS-6.jar.pack.gz"/>

<property name="Secure" value="false"/>

</resources>

<application-desc main-class="SwingTest"/>

</jnlp>

and this same works in machine where i have 1.5.

I don't know the reason why java 1.6 webstart throw this error

java.io.IOException: Corrupted pack file: magic/ver = CAFED00D/160.1 should be CAFED00D/150.7

at com.sun.java.util.jar.pack.NativeUnpack.start(Native Method)

at com.sun.java.util.jar.pack.NativeUnpack.run(Unknown Source)

at com.sun.java.util.jar.pack.NativeUnpack.run(Unknown Source)

at com.sun.java.util.jar.pack.UnpackerImpl.unpack(Unknown Source)

at com.sun.deploy.net.HttpDownloadHelper.download(Unknown Source)

at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)

at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)

at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)

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

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

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

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

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

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

at com.sun.javaws.Main.launchApp(Unknown Source)

at com.sun.javaws.Main.continueInSecureThread(Unknown Source)

at com.sun.javaws.Main$1.run(Unknown Source)

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

bharath-javaa at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 4
Where is the href attribute in your jnlp file?
riema at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 5

Hey, thanks for your reply

I changed the j2se version tag to 1.5+

and the error is gone now.

but the actuall error is with

pack200.exe changes in java 1.6

please follow this link

http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/pack200.html#testing

(read the last paragraph)

here is my latest jnlp file which has the below error :

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

<jnlp spec="1.0+" codebase="http://172.22.90.128/Rel05_01_052">

<information>

<title>JNLPTest</title>

<vendor>JNLPTest</vendor>

<description>JNLPTest</description>

<offline-allowed/>

</information>

<security><all-permissions/></security>

<resources>

<j2se version="1.5+" initial-heap-size="64m" max-heap-size="512m"/>

<jar href="iMS/STS-6.jar.pack.gz"/>

<property name="Secure" value="false"/>

</resources>

<application-desc main-class="SwingTest"/>

</jnlp>

Exception

JNLPException[category: Security Error : Exception: null : LaunchDesc:

<jnlp spec="1.0+" codebase="http://172.22.90.128/Rel05_01_052/">

<information>

<title>JNLPTest</title>

<vendor>JNLPTest</vendor>

<homepage href="null"/>

<description>JNLPTest</description>

<offline-allowed/>

</information>

<security>

<all-permissions/>

</security>

<update check="timeout" policy="always"/>

<resources>

<java initial-heap-size="67108864" max-heap-size="536870912" version="1.5+"/>

<jar href="http://172.22.90.128/Rel05_01_052/iMS/STS-6.jar.pack.gz" download="eager" main="false"/>

<property name="Secure" value="false"/>

</resources>

<application-desc main-class="SwingTest"/>

</jnlp> ]

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

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

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

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

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

at com.sun.javaws.Main.launchApp(Unknown Source)

at com.sun.javaws.Main.continueInSecureThread(Unknown Source)

at com.sun.javaws.Main$1.run(Unknown Source)

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

bharath-javaa at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 6

1stly I suggest you add an href attribute, just so there is no confusion.

More importantly, what is this file?

<jar href="http://172.22.90.128/Rel05_01_052/iMS/STS-6.jar.pack.gz" .../>

I am particularly confused about the extension.

Is this a ..

STS-6.jar.pack.gz

..or perhaps a .jar that has then be put in a..

STS-6.jar.pack.gz

..archive? ..or something else?

Note there was a recent problem where JWS 6

did no longer check .zip files for signatures.

It might be that JWS checks no other files than

those that end in .jar.

What happens if you put a plain old archive up, like..

STS-6.jar

?

AndrewThompson64a at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 7

Thanks

You are correct.

If i use a plain old jar archive. It works fine.

But in my case i have already shipped my software as jar.pack.gz to all customers

Note: I use pack200 tool to generate .jar.pack.gz from .jar(signed)

what aout backward compatiblility?

is there any defect for this?

help please.

bharath-javaa at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 8
To be more precise, the exception reason i see is :"Unsigned application requesting unrestricted access to system"do anyone have problem in webstart after updating to 1.6, if you have href as a .jar.pack.gz or any other format other than .jar in your .jnlp?
bharath-javaa at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 9
I would recommend checking the bug database.
riema at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 10

...

> do anyone have problem in webstart after updating to

> 1.6, if you have href as a .jar.pack.gz or any other

> format other than .jar in your .jnlp?

Yes. After a quick search on 'security zip 1.6' I found this..

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519657

Message was edited by:

AndrewThompson64

AndrewThompson64a at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 11
Should i confirm and relate my scenario with this defect?How will i know , when sun will fix this, i mean how long a wait. any clues?
bharath-javaa at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 12
You don't know unless of course you join in and fix the problem yourself ;)
riema at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 13

I found the problem.

It is a NEW BUG IN JAVA

If someone at SUN is reading this:

Bug 1:

You shall not send a "If-Modified-Since" if the java cache is empty.

Bug 2:

You are not allowed to set a date in "If-Modified-Since" before 1970-01-01T00:00:00Z.

See http://en.wikipedia.org/wiki/Unix_time

wi_nia at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 14

...

> It is a NEW BUG IN JAVA

Report it here.

http://bugs.sun.com/services/bugreport/index.jsp

> If someone at SUN is reading this:

The people that Sun has busy looking into bugs,

read bug reports. Bug reports that are reported

through the page above.

AndrewThompson64a at 2007-7-12 3:38:04 > top of Java-index,Desktop,Deploying...
# 15
Is anyone from SUN reading this ?Please update this thread with defect in javawebstart 1.6.
bharath-javaa at 2007-7-21 20:38:52 > top of Java-index,Desktop,Deploying...