FileNotFoundException通过HTTPS使用java webstart 1.6启动1.4.2 webstart应用程序 [英] FileNotFoundException starting 1.4.2 webstart application with java webstart 1.6 over HTTPS

查看:141
本文介绍了FileNotFoundException通过HTTPS使用java webstart 1.6启动1.4.2 webstart应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非常感谢所有需要时间阅读的人。

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.

以下是该场景:


  1. 所有流量都通过HTTPS完成

  2. 用户在网页上引用链接以启动应用程序:servlet
    生成的jnlp文件

  3. Java webstart客户端(1.6.0_29 )启动并加载应用程序
    a breath

  4. 因为在jnlp描述符中将j2se版本设置为1.4.2_12 java
    webstart 1.4.2_12用于启动应用程序(由
    1.6.0_29加载)

  5. Java webstart 1.4.2_12在启动时失败,声称它找不到一些ghostjavaws2文件

  1. All traffic is done over HTTPS
  2. User clics a link on a web page to launch the application : servlet generated jnlp file
  3. Java webstart client (1.6.0_29) starts and loads the application in a breath
  4. Because the j2se version is set to 1.4.2_12 in jnlp descriptor java webstart 1.4.2_12 is used to launch the application (loaded by 1.6.0_29)
  5. 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被禁用时。

  • 以下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).


    • Mime-type设置为:application / x-java-jnlp-file

    • Mime-type is set to : application/x-java-jnlp-file

    我不明白的是为什么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 :


    1. 用户点击jnlp链接,JNLP文件由
      浏览器下载和缓存。

    2. JWS 1.6.0_29启动然后读取下载的JNLP文件。

    3. JWS 1.6。 0_29下载所有JAR文件,然后切换到JWS 1.4.2_12。

    4. JWS 1.4.2_12启动,然后显然读取了JNLP文件。

    5. JWS 1.4.2_12尝试检索href
      属性指向的JNLP文件。

    6. 由于href为空,JWS报告无法加载指定的文件/ URL
      :C:\ DOCUME~1 \ BENOIT~1.VAT \ LOCALS~1 \Temp \ java2。 (作为附注,ghost javaws2有时被命名为javaws10或类似)

    1. User clicks a jnlp link, JNLP file is downloaded and cached by browser.
    2. JWS 1.6.0_29 starts up then read the downloaded JNLP file.
    3. JWS 1.6.0_29 downloads all JAR files and then switches to JWS 1.4.2_12.
    4. JWS 1.4.2_12 starts up and then obviously read the JNLP file in its turn.
    5. JWS 1.4.2_12 tries to retrieve the JNLP file pointed by the href attribute.
    6. 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)




    请注意:在此方案中使用JWS 1.4或1.5时,
    应用程序将启动。仅当JWS 1.6使用
    运行1.4.2_12应用程序时才会出现此问题。如果未设置
    href属性,则JWS 1.5和1.6不会失败。相反,他们只是按原样使用JNLP,检查
    JAR更新,然后启动应用程序。

    Please note : When using JWS 1.4 or 1.5 with this scenario, the application WILL start. The issue only appears when JWS 1.6 is used to run a 1.4.2_12 application. JWS 1.5 and 1.6 do not fail when no href attribute is set. Instead they simply use the JNLP as is, check the JAR updates and then launch the application.



    场景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


    1. 用户单击jnlp链接,下载JNLP文件并通过
      浏览器进行缓存。

    2. JWS 1.6.0_29启动然后读取下载的JNLP文件。

    3. JWS 1.6.0_29全部下载JAR文件,然后切换到JWS 1.4.2_12。

    4. JWS 1.4.2_12启动,然后显然读取了JNLP文件。

    5. JWS 1.4.2_12尝试检索href
      属性指向的JNLP文件。

    6. JWS 1.4.2_12 下载 href属性指向的JNLP 。

    7. JWS 1.4.2_12 下载新下载的JNLP文件中引用的所有JNLP JAR文件

    8. JWS 1.4。 2_12正确启动应用程序。

    1. User clicks a jnlp link, JNLP file is downloaded and cached by browser.
    2. JWS 1.6.0_29 starts up then read the downloaded JNLP file.
    3. JWS 1.6.0_29 downloads all JAR files and then switches to JWS 1.4.2_12.
    4. JWS 1.4.2_12 starts up and then obviously read the JNLP file in its turn.
    5. JWS 1.4.2_12 tries to retrieve the JNLP file pointed by the href attribute.
    6. JWS 1.4.2_12 downloads the JNLP pointed by the href attribute.
    7. JWS 1.4.2_12 downloads all JNLP JAR files referenced in the freshly downloaded JNLP file.
    8. 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应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆