问题描述
非常感谢所有需要时间阅读的人。
And many thanks to all who will take time for reading.
我正在努力创建一个使用java webstart 1.6启动的Webstart Swing 1.4.2_12应用程序。 0_29。
I'm struggling to make a webstart Swing 1.4.2_12 application to launch with java webstart 1.6.0_29.
以下是该场景:
- 所有流量都通过HTTPS完成
- 用户在网页上引用链接以启动应用程序:servlet
生成的jnlp文件 - Java webstart客户端(1.6.0_29 )启动并加载应用程序
a breath - 因为在jnlp描述符中将j2se版本设置为1.4.2_12 java
webstart 1.4.2_12用于启动应用程序(由
1.6.0_29加载) - Java webstart 1.4.2_12在启动时失败,声称它找不到一些ghostjavaws2文件
- All traffic is done over HTTPS
- User clics a link on a web page to launch the application : servletgenerated jnlp file
- Java webstart client (1.6.0_29) starts and loads the application ina breath
- Because the j2se version is set to 1.4.2_12 in jnlp descriptor javawebstart 1.4.2_12 is used to launch the application (loaded by1.6.0_29)
- Java webstart 1.4.2_12 fails on startup claiming that it cannot find some ghost "javaws2" file
报告以下消息:
CouldNotLoadArgumentException[ Could not load specified file/URL : C:\DOCUME~1\BENOIT~1.VAT\LOCALS~1\Temp\javaws2]
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)
完整的堆栈跟踪是:
java.io.FileNotFoundException: C:\DOCUME~1\BENOIT~1.VAT\LOCALS~1\Temp\javaws2 (File not found)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(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)
- 同样的错误OCC urs当HTTPS被禁用时。
-
Mime-type设置为:application / x-java-jnlp-file
Mime-type is set to : application/x-java-jnlp-file
以下HTTP标头都由JNLP servlet发送到客户端:
缓存控制:空
Pragma:空
Both the following HTTP headers are sent to the client by JNLP servlet :
Cache-Control : empty
Pragma : empty
这些标头是防止IE在HTTPS模式下禁用缓存所必需的,这会阻止java webstart找到加载的jnlp文件(因为它没有被缓存)。
These headers are necessary to prevent IE to disable caching in HTTPS mode wich prevents java webstart to find the loaded jnlp file (because it is not cached).
我不明白的是为什么java 1.4.2_12找不到JWS 1.6.0_29加载的jnlp文件?
What I do not understand is why java 1.4.2_12 cannot find the jnlp file loaded by JWS 1.6.0_29 ?
感谢阅读。
推荐答案
@Andrew:感谢您的关注。
@Andrew : Thank you for your interest.
这是我的关于这个问题的结论。
Here comes my conclusions on that issue.
简而言之:始终在jnlp标签中设置href属性!
<jnlp spec="1.0+" codebase="htt://myhost/codebase" href="mustSetThisAbsolutelyForJWS-1.4.2_12.jnlp">
...
</jnlp>
多个HTTP调试会话显示:
Multiple HTTP debug sessions have shown that :
- 用户点击jnlp链接,JNLP文件由
浏览器下载和缓存。 - JWS 1.6.0_29启动然后读取下载的JNLP文件。
- JWS 1.6。 0_29下载所有JAR文件,然后切换到JWS 1.4.2_12。
- JWS 1.4.2_12启动,然后显然读取了JNLP文件。
- JWS 1.4.2_12尝试检索href
属性指向的JNLP文件。 - 由于href为空,JWS报告无法加载指定的文件/ URL
:C:\ DOCUME~1 \ BENOIT~1.VAT \ LOCALS~1 \Temp \ java2。 (作为附注,ghost javaws2有时被命名为javaws10或类似)
- User clicks a jnlp link, JNLP file is downloaded and cached bybrowser.
- JWS 1.6.0_29 starts up then read the downloaded JNLP file.
- JWS 1.6.0_29 downloads all JAR files and then switches to JWS 1.4.2_12.
- JWS 1.4.2_12 starts up and then obviously read the JNLP file in its turn.
- JWS 1.4.2_12 tries to retrieve the JNLP file pointed by the hrefattribute.
- Since href is empty, JWS reports "Could not load specified file/URL: C:\DOCUME~1\BENOIT~1.VAT\LOCALS~1\Temp\javaws2". (As a side note, ghost javaws2 is sometimes named javaws10 or similar)
场景2:href属性设置为正确值,JNLP文件与客户端上的JWS 1.6相关联
Scenario 2: href attribute is set with a proper value and JNLP files are associated with JWS 1.6 on the client
- 用户单击jnlp链接,下载JNLP文件并通过
浏览器进行缓存。 - JWS 1.6.0_29启动然后读取下载的JNLP文件。
- JWS 1.6.0_29全部下载JAR文件,然后切换到JWS 1.4.2_12。
- JWS 1.4.2_12启动,然后显然读取了JNLP文件。
- JWS 1.4.2_12尝试检索href
属性指向的JNLP文件。 - JWS 1.4.2_12 下载 href属性指向的JNLP 。
- JWS 1.4.2_12 下载新下载的JNLP文件中引用的所有JNLP JAR文件。
- JWS 1.4。 2_12正确启动应用程序。
- User clicks a jnlp link, JNLP file is downloaded and cached bybrowser.
- JWS 1.6.0_29 starts up then read the downloaded JNLP file.
- JWS 1.6.0_29 downloads all JAR files and then switches to JWS 1.4.2_12.
- JWS 1.4.2_12 starts up and then obviously read the JNLP file in its turn.
- JWS 1.4.2_12 tries to retrieve the JNLP file pointed by the hrefattribute.
- JWS 1.4.2_12 downloads the JNLP pointed by the href attribute.
- JWS 1.4.2_12 downloads all JNLP JAR files referenced in the freshly downloaded JNLP file.
- JWS 1.4.2_12 launches the application correctly.
对我来说,这对我来说是一个很大的痛苦,并花了我几天的时间才弄明白这一点。希望有一天能帮助别人。
It's been a major pain in the neck for me and took me days to figures this out. Hope this will help someone one day.
这篇关于FileNotFoundException通过HTTPS使用java webstart 1.6启动1.4.2 webstart应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!