Java Web 启动 - 无法加载资源 [英] Java web start - Unable to load resource

查看:22
本文介绍了Java Web 启动 - 无法加载资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 jar,当我浏览服务器的 IP 地址时,它可以很好地加载 java web start.一旦我尝试使用服务器 name,我就会收到以下异常:

<前>com.sun.deploy.net.FailedDownloadException:无法加载资源:在 com.sun.deploy.net.DownloadEngine.actionDownload(来源不明)在 com.sun.deploy.net.DownloadEngine.getCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getResource(来源不明)在 com.sun.javaws.LaunchDownload$DownloadTask.call(来源不明)在 java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)在 java.util.concurrent.FutureTask.run(未知来源)在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)在 java.util.concurrent.ThreadPoolExecutor$Worker.run(未知来源)在 java.lang.Thread.run(未知来源)

包装的异常:

<前>java.io.FileNotFoundException:在 sun.reflect.GeneratedConstructorAccessor2.newInstance(来源不明)在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(未知来源)在 java.lang.reflect.Constructor.newInstance(Unknown Source)在 sun.net.www.protocol.http.HttpURLConnection$6.run(来源不明)在 java.security.AccessController.doPrivileged(Native Method)在 sun.net.www.protocol.http.HttpURLConnection.getChainedException(未知来源)在 sun.net.www.protocol.http.HttpURLConnection.getInputStream(来源不明)在 com.sun.deploy.net.BasicHttpRequest.doRequest(来源不明)在 com.sun.deploy.net.BasicHttpRequest.doRequest(来源不明)在 com.sun.deploy.net.BasicHttpRequest.doGetRequest(来源不明)在 com.sun.deploy.net.DownloadEngine.actionDownload(来源不明)在 com.sun.deploy.net.DownloadEngine.getCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(来源不明)在 com.sun.deploy.net.DownloadEngine.getResource(来源不明)在 com.sun.javaws.LaunchDownload$DownloadTask.call(来源不明)在 java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)在 java.util.concurrent.FutureTask.run(未知来源)在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)在 java.util.concurrent.ThreadPoolExecutor$Worker.run(未知来源)在 java.lang.Thread.run(未知来源)引起:java.io.FileNotFoundException:在 sun.net.www.protocol.http.HttpURLConnection.getInputStream(来源不明)在 java.net.HttpURLConnection.getResponseCode(来源不明)……还有 15 个

JNLP:

<信息><title>title</title><vendor>vendor</vendor><description>description</description><description kind="short">short</description><icon href="../../icon.gif"/></信息><安全><所有权限/></安全><资源><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"/></资源><application-desc main-class="com...."><参数>CD6B172DEC34924D83EA64A61A6550BE1271325929392</参数><参数>http://servername/file.asp</argument><参数>/站点</参数></application-desc></jnlp>

知道我应该寻找什么吗?

解决方案

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

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?

解决方案

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

这篇关于Java Web 启动 - 无法加载资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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