我有一个运行Java Web Start的已由Netbeans的7所
我已经迁移我现有的Java 6.9.1应用程序的Netbeans 7应用程序有些麻烦并试图使其成为一个网络启动应用程序。
为此,我已从项目属性中选中了“启用Web启动”选项。
对于代码库选项,我选择了Web应用程序部署。 应用程序描述符是选中的选项,它将JNLP application-desc元素指向我的应用程序主类。
对于签名,我已经生成了一个密钥并在此处指出签名属性。我将混合代码设置为“仅受信任”,因为我的应用程序仅使用签名的JAR。
当我编译,所有被引用的JAR文件和应用程序JAR文件的签署是在控制台(每一个人)输出:
Signing JAR: D:\MyCode\dist\lib\somejarfile.jar to D:\MyCode\dist\lib\somejarfile.jar as signFiles
Enter Passphrase for keystore: Enter key password for signFiles:
注: signFiles是我用过的别名在Netbeans的签名属性中。
- LIB
- jnlpcomponent1.jnlp
- launch.html
- launch.jnlp
- README.TXT
- 我的应用:
下面的文件在我的文件夹DIST创建.jar
我已将这些复制到我在Tomcat托管的Web文件夹中,该文件夹是C:\ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ webapps \ mywebapp。
我在IE和Firefox下面的网址上运行: http://mylaptop:8080/mywebapp/launch.html
,当我在launch.html点击按钮启动JNLP文件以下异常被抛出:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/panderson/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/B3UCQV8C/$$codebase/launch.jnlp
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(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.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(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)
我launch.jnlp文件有以下几点:
<jnlp codebase="$$codebase" href="launch.jnlp" spec="1.0+">
...
<resources>
<j2se version="1.6+"/>
<jar href="My App.jar" main="true"/>
...
我也不太清楚为什么它正在寻求在互联网EXPL的临时文件夹下ORER它...
...但我试图把完整的URL在JNLP HREF到launch.JNLP文件http://mylaptop:8080/mywebapp/launch.jnlp那么它抛出以下异常:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/panderson/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/DR2O6URQ/$$codebase/My App.jar
若我改变jar href到http://mylaptop:8080/mywebapp/My App.jar,当我点击launch.html中的按钮来运行launch.JNLP文件时,会引发以下异常。
BadFieldException[ The field <jnlp>codebase has an invalid value: $$codebase,$$codebase]
任何帮助或想法?
干杯,
Andez
@Andrew--有希望成为JWS问题。只要使用netbeans - 它有时会隐藏您在运行时碰到的潜在问题。 :-( – Andez