Java Web 启动 - 无法加载资源

发布于 2024-08-28 19:03:46 字数 4052 浏览 3 评论 0 原文

当我浏览服务器的 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>

知道我应该寻找什么吗?

I've got a jar that loads great with java web start when I browse through the IP address of the server.
Once I try the server name instead I get the following exception:

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)

The wrapped exception:

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>

Any idea what should I look for?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

北陌 2024-09-04 19:03:46

我已将 java 代理设置更改为直接连接 - 并且它有效。

I've changed the java proxy settings to direct connection - and it works.

﹉夏雨初晴づ 2024-09-04 19:03:46

尝试使用 Janelagithub 来诊断问题。

Try using Janela or github to diagnose the problem.

白馒头 2024-09-04 19:03:46

在相应服务器的主机文件 (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

戏剧牡丹亭 2024-09-04 19:03:46

我不确定到底是什么问题,但我查看了我的 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!

小兔几 2024-09-04 19:03:46

如果其他人因为尝试设置 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"

戈亓 2024-09-04 19:03:46

我遇到了同样的问题,我用服务器地址更新了主机文件,它起作用了

i got the same issue, i updated the hosts file with the server address and it worked

烟燃烟灭 2024-09-04 19:03:46

将 java 代理设置更改为直接连接并没有解决我的问题。

对我有用的是:

  1. 以管理员身份运行“配置 Java”。
  2. 转到高级
  3. 滚动到底部
  4. 在:“高级安全设置”下取消选中“使用 SSL 2.0 兼容的 ClientHello 格式”
  5. 保存

changing java proxy settings to direct connection did not fix my issue.

What worked for me:

  1. Run "Configure Java" as administrator.
  2. Go to Advanced
  3. Scroll to bottom
  4. Under: "Advanced Security Settings" uncheck "Use SSL 2.0 compatible ClientHello format"
  5. Save
静谧幽蓝 2024-09-04 19:03:46

这也对我有用,非常感谢

将 java 代理设置更改为直接连接并没有解决我的问题。

对我有用的:

Run "Configure Java" as administrator.
Go to Advanced
Scroll to bottom
Under: "Advanced Security Settings" uncheck "Use SSL 2.0 compatible ClientHello format"
Save

this also worked for me , thanks a lot

changing java proxy settings to direct connection did not fix my issue.

What worked for me:

Run "Configure Java" as administrator.
Go to Advanced
Scroll to bottom
Under: "Advanced Security Settings" uncheck "Use SSL 2.0 compatible ClientHello format"
Save
聽兲甴掵 2024-09-04 19:03:46

输入图片此处描述

在“高级”选项卡中 ->向下滚动并取消选中提前安全设置中的所有选项,然后尝试逐一检查,最后应用程序开始使用一个选项 TLS 1.1 运行,

这就是我得到的解决方案。

enter image description here

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.

深海蓝天 2024-09-04 19:03:46
  1. 禁用所有包含 C:\Program Files\Java\jre1.8.0_361\lib\security\java.security 文件中的行的“MD5”

2.在异常配置 java>>security>> 编辑站点列表

url 中添加 IP url示例:https://10.50.25.58

  1. Disable all "MD5" containing lines from C:\Program Files\Java\jre1.8.0_361\lib\security\java.security file

2.Add IP url in the exception configure java>>security>>Edit Site list

url example:https://10.50.25.58

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文