Java Web 启动 - 无法加载资源
当我浏览服务器的 IP 地址时,我有一个 jar 可以通过 java web start 很好地加载。 一旦我尝试服务器名称,我就会得到以下异常:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: 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.javaws.LaunchDownload$DownloadTask.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
包装的异常:
java.io.FileNotFoundException: at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(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.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.javaws.LaunchDownload$DownloadTask.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.FileNotFoundException: at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) ... 15 more
JNLP:
<?xml version="1.0" encoding="utf-8"?>
<jnlp
spec="1.0+"
codebase="http://servername/Site/Views/.."
href="">
<information>
<title>title</title>
<vendor>vendor</vendor>
<description>description</description>
<description kind="short">short</description>
<icon href="../../icon.gif" />
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+" java-vm-args="-Xmx1000M -Xms150M" initial-heap-size="150M" max-heap-size="1000M" />
<j2se version="1.4.2+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Xmx1000M -Xms150M" initial-heap-size="150M" max-heap-size="1000M" />
<jar href="/file.jar"/>
</resources>
<application-desc main-class="com....">
<argument>CD6B172DEC34924D83EA64A61A6550BE1271325929392</argument>
<argument>http://servername/file.asp</argument>
<argument>/Site</argument>
</application-desc>
</jnlp>
知道我应该寻找什么吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
我已将 java 代理设置更改为直接连接 - 并且它有效。
I've changed the java proxy settings to direct connection - and it works.
尝试使用 Janela 或 github 来诊断问题。
Try using Janela or github to diagnose the problem.
在相应服务器的主机文件 (C:\Windows\System32\drivers\etc\host) 中包含您的 IP 地址:
示例条目:
10.100.101.102 server1.us.vijay.com Vijay 的服务器
Include your IP address in your host file (C:\Windows\System32\drivers\etc\host) for the respective server:
Sample Entry:
10.100.101.102 server1.us.vijay.com Vijay's Server
我不确定到底是什么问题,但我查看了我的 jnlp 文件之一,并输入了每个 jar 文件的完整路径。 (我有一个生成 app.jnlp 文件的速度模板,当我的 Maven 构建运行时,该文件将其放置在所有正确的位置)
我看到发生的一件事是 jnlp 文件由 webstart 运行时重新下载,并且它使用 href 属性(在 jnlp 文件中留空)来重新下载文件。我会从那里开始,并尝试将完整路径也添加到 jnlp 文件中...我发现 webstart 是一个善变的情妇!
I'm not sure exactly what the problem is, but I have looked at one of my jnlp files and I have put in the full path to each of my jar files. (I have a velocity template that generates the app.jnlp file which places it in all the correct places when my maven build runs)
One thing I have seen happen is that the jnlp file is re-downloaded by the by the webstart runtime, and it uses the href attribute (which is left blank in your jnlp file) to re-download the file. I would start there, and try adding the full path into the jnlp files too...I've found webstart to be a fickle mistress!
如果其他人因为尝试设置 Jenkins 从站而到达这里,那么您需要将主机的 url 设置为它实际使用的地址。
在主机上,转到“管理 Jenkins >”配置系统并编辑“Jenkins URL”
If anyone else gets here because they're trying to set up a Jenkins slave, then you need to set the url of the host to the one it's actually using.
On the host, go to Manage Jenkins > Configure System and edit "Jenkins URL"
我遇到了同样的问题,我用服务器地址更新了主机文件,它起作用了
i got the same issue, i updated the hosts file with the server address and it worked
将 java 代理设置更改为直接连接并没有解决我的问题。
对我有用的是:
changing java proxy settings to direct connection did not fix my issue.
What worked for me:
这也对我有用,非常感谢
将 java 代理设置更改为直接连接并没有解决我的问题。
对我有用的:
this also worked for me , thanks a lot
changing java proxy settings to direct connection did not fix my issue.
What worked for me:
在“高级”选项卡中 ->向下滚动并取消选中提前安全设置中的所有选项,然后尝试逐一检查,最后应用程序开始使用一个选项 TLS 1.1 运行,
这就是我得到的解决方案。
In Advance Tab -> scroll down and un-checked all options in advance security setting and try by checking one-by-one and finally app start running with one option TLS 1.1
that was the solution I got it.
2.在异常配置 java>>security>> 编辑站点列表
url 中添加 IP url示例:https://10.50.25.58
2.Add IP url in the exception configure java>>security>>Edit Site list
url example:https://10.50.25.58