Java 新手:JNLP 应用程序无法运行(无法加载资源)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21387722/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Novice: JNLP app won't run (Unable to Load Resources)
提问by user3241469
Forgive me, but I'm very new to this. I have a JNLP file on my work computer, and have access to work at home. I set up my VPN, and copy/pasted the JNLP file to my home computer. However, when I launch it (I upgraded to Java 7 using Windows 7 Home Premium), I get the Unable to Launch Application issue.
原谅我,但我对此很陌生。我的工作计算机上有一个 JNLP 文件,可以在家工作。我设置了我的 VPN,并将 JNLP 文件复制/粘贴到我的家用计算机上。但是,当我启动它时(我使用 Windows 7 Home Premium 升级到 Java 7),我遇到了无法启动应用程序的问题。
It shows Unable to Load Resources and then
它显示无法加载资源,然后
com.sun.deploy.net.FailedDownloadException: Unable to load resource: http: //pbs-sj1/pbs/jnlp/tnp/msgr/alt.jnlp
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.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.accessjava.net.UnknownHostException: pbs-sj1
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.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.accessjava.net.UnknownHostException: pbs-sj1
0(Unknown Source)
at com.sun.javaws.Main.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
0(Unknown Source)
at com.sun.javaws.Main.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
This is under the wrapped section
这是在包裹部分下
127.0.0.1 pbs-sj1
I've researched online quite a bit but to be honest, most of it seems to be on a developer level. I'm just trying to get the JNLP file to launch.
我在网上研究了很多,但老实说,其中大部分似乎是在开发人员层面上。我只是想让 JNLP 文件启动。
Any ideas?
有任何想法吗?
回答by unigeek
The error message is telling you that it can't figure out what host you are trying to reach:
错误消息告诉您它无法确定您尝试访问的主机:
file:///C:/Documents%20and%20Settings/your_login/alt.jnlp
Probably the easiest thing to do is to edit your hosts file on the box you have this .jnlp file and add:
可能最简单的方法是在您拥有这个 .jnlp 文件的盒子上编辑您的主机文件并添加:
##代码##Then make sure your actual .jnlp file location lines up with the rest of the path you specified (/pbs/jnlp/tnp/msgr/alt.jnlp). Here's a howtoon editing your hosts file on Win7.
然后确保您的实际 .jnlp 文件位置与您指定的其余路径 (/pbs/jnlp/tnp/msgr/alt.jnlp) 对齐。这里有一个HOWTO上编辑Win7上的hosts文件。
-OR-
-或者-
Rather than mess with the Hosts file, just make use of a file URL to specify where to find the .JNLP file on Windows--e.g.,
与其弄乱 Hosts 文件,不如使用文件 URL 来指定在 Windows 上在哪里可以找到 .JNLP 文件——例如,
##代码##(I'm assuming you know to paste/type either of these addresses into your Java-enabled browser's address bar)
(我假设您知道将这些地址中的任何一个粘贴/键入到启用 Java 的浏览器的地址栏中)